<html>
<!--

NOTE - Due to a bug in IE55 (who knows or cares if it exists in higher versions)
any use of the /PRE, appends "&bnsp;<br>" to your preformatted text
(M$ really are a team of grade A programmers aren't they?)
...which means that LOADS and LOADS of formatting work I did to make this document
sexy will be ignored by IE

USE OPERA  .... WWW.OPERA.COM

Nothing new, just old news repackaged
...this is how I learn a new processor
...Once written; never forgotten

If you find it helpful then great,
if not erase it and let us never speak of such travesty again.

If you find problems with it, typos, errors, whatever,
I'd love to hear from you and rest assured it will be corrected.

NB. I produce (as) readable (as it gets) HTML code
    For formatting reasons I use a tag "<x>";
    it has never caused me a problem - every browser I know of simply ignores it.
    If you have a problem with it just do SearcAndReplace "<x>" with ""
      ...and we'll all will be merry and bright.

JEEZUZ - W3C validator HATES me - LOL

Greetz go out to: runderwo, OzOne, CrowTRobo, Toni Baker
-->

  <head>
    <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon">

    <title>6502 Programmers Reference</title>
  </head>

  <body>

    <a name="_top"></a>
    <br>
    <hr width="80%">
    <center>
      <h1>Rockwell <a href="http://www.6502.org">6502</a> Programmers Reference</h1>
    </center>
    <hr width="80%">
    <br><br>

<!-- Cyborg Sytems HTML Logo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<a href="http://homepage.ntlworld.com/cyborgsystems">
    <table summary="" align="center" border="0">
      <tr><td bgcolor="#000080" colspan="3">
<pre><font size="1" color="#FFFFFF"><font color="black">&Oslash;</font><font color="black">_________________</font>    <font color="black">_</font>     <font color="black">_</font>    <font color="black">_______</font>    <font color="black">_______</font>   <font color="black">________</font>    <font color="black">_______</font>              <font color="black">&Oslash;</font>
 &AElig;&AElig;&AElig;             &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  &AElig;&AElig;<font color="black">_</font>   &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  <font color="black">___</font>   &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  Est. 1984
 &AElig;<font color="black">&yen;</font>&AElig;             &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&yen;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;
 &AElig;<font color="black">&yen;</font>&AElig;             &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;
 &AElig;<font color="black">&plusmn;</font>&AElig;             <font color="black">&trade;&trade;&trade;</font>  &AElig; &AElig; <font color="black">&divide;</font> &AElig; &AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig; &AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig; &AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> <font color="black">&trade;&trade;&trade;</font>
 &AElig;<font color="black">&plusmn;</font>&AElig;                  &AElig; &AElig;   &AElig; &AElig;  &AElig; &AElig;<font color="black">___</font>&AElig;<font color="black">&trade;&trade;</font>  &AElig; &AElig; <font color="black">^</font> &AElig; &AElig;  &AElig; &AElig;<font color="black">___</font>&AElig;&AElig;<font color="black">&trade;</font>  &AElig; &AElig;
 &AElig;<font color="black">&divide;</font>&AElig;                  <font color="black">&trade;</font>&AElig;&AElig;&AElig;<font color="black">&trade;</font>&AElig;&AElig;&AElig;<font color="black">&trade;</font>  &AElig; &AElig;<font color="black">&trade;&trade;&trade;</font>&AElig;<font color="black">__</font>  &AElig; &AElig; <font color="black">v</font> &AElig; &AElig;  &AElig; &AElig;  &AElig; &AElig;   &AElig; &AElig; <font color="black">&trade;&trade;</font>&AElig;&AElig;&AElig;
 &AElig;<font color="black">&divide;</font>&AElig;                     &AElig; &AElig;     &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig; &AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig;  &AElig; &AElig;   &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig; &AElig;
 &AElig;<font color="black">&divide;</font>&AElig;                     &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig;   &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;
 &AElig; &AElig;                     &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&yen;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig;   &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;
 &AElig;<font color="black">1</font>&AElig;                     &AElig;&AElig;&AElig;     &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;<font color="black">&trade;</font>   &AElig;&AElig;&AElig;
 &AElig;<font color="black">3</font>&AElig;                    <font color="black">&trade;&trade;&trade;&trade;&trade;</font>     <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>    <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>   <font color="black">&trade;&trade;&trade;</font>   <font color="black">&trade;&trade;&trade;</font>   <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>
 &AElig;<font color="black">5</font>&AElig;        <font color="black">_______</font>    <font color="black">_</font>     <font color="black">_</font>    <font color="black">_______</font>   <font color="black">_________</font>   <font color="black">_______</font>    <font color="black">_______</font>    <font color="black">_______</font>
 &AElig;<font color="black">8</font>&AElig;       &AElig;&AElig;<font color="black">_</font>   &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  &AElig;&AElig;<font color="black">_</font>   &AElig;&AElig;&AElig;  &AElig;&AElig;<font color="black">&trade;</font>&AElig;&AElig;&AElig;<font color="black">&trade;</font>&AElig;&AElig;  &AElig;&AElig;<font color="black">_</font> &AElig;&AElig;&AElig;&AElig;&AElig;  &AElig;&AElig;&AElig; &AElig; &AElig;&AElig;&AElig;  &AElig;&AElig;<font color="black">_</font>   &AElig;&AElig;&AElig;
 &AElig; &AElig;       &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&yen;</font>&AElig;     &AElig;<font color="black">&yen;</font>&AElig;        &AElig;<font color="black">&yen;</font>&AElig; &AElig; &AElig;<font color="black">&yen;</font>&AElig;  &AElig;<font color="black">&yen;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;
 &AElig;<font color="black">&divide;</font>&AElig;       &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig;        &AElig;<font color="black">&plusmn;</font>&AElig; &AElig; &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;
 &AElig;<font color="black">&divide;</font>&AElig;       &AElig;<font color="black">&divide;</font>&AElig;   <font color="black">&trade;&trade;&trade;</font>  &AElig; &AElig; <font color="black">&divide;</font> &AElig; &AElig;  &AElig;<font color="black">&divide;</font>&AElig;   <font color="black">&trade;&trade;&trade;</font>     &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&divide;</font>&AElig;        &AElig;<font color="black">&divide;</font>&AElig; &AElig; &AElig;<font color="black">&divide;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig;   <font color="black">&trade;&trade;&trade;</font>
 &AElig;<font color="black">&divide;</font>&AElig;       <font color="black">&trade;</font>&AElig;&AElig;<font color="black">____</font>    &AElig; &AElig;   &AElig; &AElig;  <font color="black">&trade;</font>&AElig;&AElig;<font color="black">____</font>       &AElig; &AElig;     &AElig; &AElig;<font color="black">__</font>&AElig;<font color="black">&trade;&trade;</font>   &AElig; &AElig; <font color="black">&yen;</font> &AElig; &AElig;  <font color="black">&trade;</font>&AElig;&AElig;<font color="black">____</font>
 &AElig;<font color="black">&plusmn;</font>&AElig;         <font color="black">&trade;&trade;&trade;&trade;</font>&AElig;&AElig;<font color="black">_</font>  <font color="black">&trade;</font>&AElig;&AElig;&AElig;<font color="black">&trade;</font>&AElig;&AElig;&AElig;<font color="black">&trade;</font>    <font color="black">&trade;&trade;&trade;&trade;</font>&AElig;&AElig;<font color="black">_</font>     &AElig; &AElig;     &AElig; &AElig;<font color="black">&trade;&trade;</font>&AElig;<font color="black">__</font>   &AElig; &AElig; <font color="black">&plusmn;</font> &AElig; &AElig;    <font color="black">&trade;&trade;&trade;&trade;</font>&AElig;&AElig;<font color="black">_</font>
 &AElig;<font color="black">&plusmn;</font>&AElig;       &AElig;&AElig;&AElig;   &AElig; &AElig;     &AElig; &AElig;     &AElig;&AElig;&AElig;   &AElig; &AElig;     &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&divide;</font>&AElig;        &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;  &AElig;&AElig;&AElig;   &AElig; &AElig;
 &AElig;<font color="black">&yen;</font>&AElig;     <font color="black">_</font> &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig;        &AElig;<font color="black">&plusmn;</font>&AElig;   &AElig;<font color="black">&plusmn;</font>&AElig;  &AElig;<font color="black">&divide;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&divide;</font>&AElig;
 &AElig;<font color="black">&yen;</font>&AElig;     &AElig; &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;     &AElig;<font color="black">&yen;</font>&AElig;     &AElig;<font color="black">&yen;</font>&AElig;        &AElig;<font color="black">&yen;</font>&AElig;   &AElig;<font color="black">&yen;</font>&AElig;  &AElig;<font color="black">&plusmn;</font>&AElig; <font color="black">&divide;</font> &AElig;<font color="black">&plusmn;</font>&AElig;
 &AElig;&AElig;&AElig;     &AElig; &AElig;&AElig;&AElig;   <font color="black">&trade;</font>&AElig;&AElig;     &AElig;&AElig;&AElig;     &AElig;&AElig;&AElig;   <font color="black">&trade;</font>&AElig;&AElig;     &AElig;&AElig;&AElig;     &AElig;&AElig;<font color="black">&trade;</font> &AElig;&AElig;&AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   &AElig;&AElig;&AElig;  &AElig;&AElig;&AElig;   <font color="black">&trade;</font>&AElig;&AElig;
<font color="black">&Oslash;</font> <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>  <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>     <font color="black">&trade;&trade;&trade;&trade;&trade;</font>     <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>      <font color="black">&trade;&trade;&trade;</font>      <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>   <font color="black">&trade;&trade;&trade;</font>   <font color="black">&trade;&trade;&trade;</font>   <font color="black">&trade;&trade;&trade;&trade;&trade;&trade;&trade;</font>  <font color="black">&Oslash;</font>
</font></pre>
      </td></tr>

      <!-- Suffix Line "BRINGING YOU THE FACTS" -->
      <tr>
        <!-- Cyborg -->
        <td>
          <font color="black"><i>&Ccedil;yb&ocirc;rg</i></font>
        </td>
        <!-- Hook -->
        <td align="center">
          <table summary="Bringing You the Facts" align="center" bgcolor="#ffffff"><tr><td>
            <pre><font color="black"> - BRINGING YOU THE FACTS - </font></td></tr></table>
            <!-- The missing "/pre" stops IE5 from adding a "br", but not the extra space :( -->
        </td>
        <!-- Systems -->
        <td align="right">
            <font color="black"><i>S&yuml;stem$</i></font>
        </td>
      </tr>
      </tr>

      <!-- Authored by: -->
      <tr>
        <td colspan="3" align="center">
          Authored by: Bluechip
        </td>
      </tr>
    </table>
</a>
<br><br>

    <a name="index">&nbsp;</a>
    <center>
      <br>
      <hr width="30%">
      <big><big><big><b><font color="black">Index</font></b></big></big></big><br>
      <hr width="30%"><br><br>
      <A href="#QUICK"><big><b>Quick Reference</b></big></A><br>
<br>
      <A href="#BY_TBL"><big><b>Instruction set Lookup Table</b></big></A><br>
      <A href="#DETAIL"><big><b>Detailed Instruction Reference</b></big></A><br>
      <A href="#BY_PRP"><big><b>Instructions by Purpose</b></big></A><br>
<br>
      <A href="#FLAGS"><big><b>Processor Status Word (Flags)</b></big></A><br>
      <A href="#BCD"><big><b>Binary Coded Decimal (BCD)</b></big></A><br>
<br>
      <A href="#ADDR_MODE"><big><b>Addressing Modes</b></big></A><br>
      <A href="#MEM_MAP"><big><b>6502 Memory Map</b></big></A><br>
<br>
      <A href="#STACK"><big><b>The Stack</b></big></A><br>
<br>
      <A href="#FLOW"><big><b>Program Flow Control</b></big></A><br>
<br>
      <A href="#INT"><big><b>Interrupts and Interrupt ReQuests (IRQ's)</b></big></A><br>
      <A href="#BOOT"><big><b>System Startup sequence (boot-strap)</b></big></A><br>
<br>
      <A href="#BIBLIO"><big><b>Bibliography</b></big></A><br>
<br><br>      
Please ask questions or report any errors you may find <A HREF="http://forum.6502.org/viewtopic.php?t=1305" target="_blank">here</A>
      
    </center>
    <br><br>

    <br><A name="BY_TBL">&nbsp;</A>
    <center>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Instruction set Lookup Table
      </font></h1></td></tr></table>
    </center>
    <br><br>

    <center><table summary="" border="0">
      <tr><td valign="top" width="10%">
        <table summary="" border="1">
          <tr><td align="left"><small><b>I-Len</b></small></td>
              <td align="right"><small><b>T-Cnt</b></small></td></tr>
          <tr><th colspan="2">Mnemonic</th></tr>
          <tr><td align="center" colspan="2"><small>Address Mode</small></td></tr>
        </table>
      </td><td width="5%">
        &nbsp;
      </td><td>
        <table summary="" border="0">
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            I-Len : Instruction length.  The number of bytes of memory required to store the instruction.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            T-Cnt : Timing Cycle (T-State) count.  The number of clock cycles required to execute
            the instruction.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Mnemonic : The abbreviated "human readable" identity of the instruction
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Address Mode : The <a href="#ADDR_MODE">memory addressing mode</a> used by the instruction.
            </td></tr>
        </table>
      </td>
      </tr><tr><td colspan="3">&nbsp;</td></tr>
      <tr><td colspan="3">
        The opcode for any instruction may be composed by reading the row and column it is in.
      </tr><tr><td colspan="3">
        By example:
      </tr><tr><td colspan="3">
        <table summary="" border="0" width="100%">
          <tr><td width="3%">&nbsp;</td><td>
            "ASL" in "Absolute" addressing mode is in row "1-", column "-E"<br>
          </td></tr>
          <tr><td width="3%">&nbsp;</td><td>
            Therefore it's opcode (hexadecimal representation) is "1E" (or $1E or 0x1E)
          </td></tr>
        </table>
      </td></tr>
      <tr><td colspan="3">&nbsp;</td></tr>
      <tr><td colspan="3">
        Some instructions (or more specifically <A href="#ADDR_MODE">Addressing Modes</A>)
        require either one or two bytes of data as a parameter.
      </tr>
      <tr><td colspan="3">
        Under these circumstances, this data immediately follows the instruction itself.
      </tr>
      <tr><td colspan="3">
        By Example:
      </tr>
      <tr><td colspan="3">
        <table summary="" border="0" width="100%">
          <tr><td width="2%">&nbsp;</td><td colspan="2">
            <table summary="" border="0"><tr><td bgcolor="#ffffff">
<pre> <u> Mnemonic Code   </u>   <u> Assembled Code   </u>
   PLA                 $68
   BEQ   $03           $F0 $9F
   JMP   $A5B6         $4C $B6 $A5      </pre>
            </td></tr></table>
          </td>
          </tr>
        </table>
      </tr>
    </table></center>
    <br>
    <br>

    <table summary="" border="1" cellpadding="0" width="100%">
      <tr align="center">
        <th width="5%">&nbsp;</th>
        <th width="5%"><big><big>-</big></big>0</th>
        <th width="5%"><big><big>-</big></big>1</th>
        <th width="5%"><big><big>-</big></big>2</th>
        <th width="5%"><big><big>-</big></big>3</th>
        <th width="5%"><big><big>-</big></big>4</th>
        <th width="5%"><big><big>-</big></big>5</th>
        <th width="5%"><big><big>-</big></big>6</th>
        <th width="5%"><big><big>-</big></big>7</th>
        <th width="5%"><big><big>-</big></big>8</th>
        <th width="5%"><big><big>-</big></big>9</th>
        <th width="5%"><big><big>-</big></big>A</th>
        <th width="5%"><big><big>-</big></big>B</th>
        <th width="5%"><big><big>-</big></big>C</th>
        <th width="5%"><big><big>-</big></big>D</th>
        <th width="5%"><big><big>-</big></big>E</th>
        <th width="5%"><big><big>-</big></big>F</th>
        <th width="5%">&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;0<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          7       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#BRK">BRK     </a></th></tr>
          <tr><td align="center" colspan="2"><small>Implied </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>(Ind,X) </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          3       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ZP      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          5       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ASL">ASL     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ZP      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          3       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#PHP">PHP     </a></th></tr>
          <tr><td align="center" colspan="2"><small>Implied </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          2       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>Immed   </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          2       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ASL">ASL     </a></th></tr>
          <tr><td align="center" colspan="2"><small>Accum   </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ABS     </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ASL">ASL     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ABS     </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;0<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;1<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          **2     </b></small></td></tr>
          <tr><th colspan="2">       <a href="#BPL">BPL     </a></th></tr>
          <tr><td align="center" colspan="2"><small>Relative</small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          5+      </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>(Ind),Y </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          4       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ZP,X    </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ASL">ASL     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ZP,X    </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          2       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#CLC">CLC     </a></th></tr>
          <tr><td align="center" colspan="2"><small>Implied </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4+      </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ABS,Y   </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4+      </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ORA">ORA     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ABS,X   </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          7       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#ASL">ASL     </a></th></tr>
          <tr><td align="center" colspan="2"><small>ABS,X   </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;1<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;2<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          3       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          3       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          5       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          4       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          2       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          2       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;2<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;3<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          **2     </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          5+      </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          4       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           2       </b></small></td>
              <td align="right"><small><b>          6       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           1       </b></small></td>
              <td align="right"><small><b>          2       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4+      </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          4+      </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           3       </b></small></td>
              <td align="right"><small><b>          7       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;3<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;4<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;4<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;5<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;5<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;6<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;6<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;7<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;7<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;8<big><big>-</big></big>&nbsp;</th>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;8<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;9<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;9<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;A<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;A<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;B<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;B<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;C<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;C<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;D<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;D<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;E<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;E<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr>
        <th align="center">&nbsp;F<big><big>-</big></big>&nbsp;</th>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td><table summary="" align="center" border="0">
          <tr><td align="left"><small><b>           x       </b></small></td>
              <td align="right"><small><b>          x       </b></small></td></tr>
          <tr><th colspan="2">       <a href="#xxx">xxx     </a></th></tr>
          <tr><td align="center" colspan="2"><small>mm      </small></td></tr>
        </table></td>
        <td>&nbsp;</td>
        <th align="center">&nbsp;F<big><big>-</big></big>&nbsp;</th>
      </tr>

      <tr align="center">
        <th width="7%">&nbsp;</th>
        <th width="7%"><big><big>-</big></big>0</th>
        <th width="7%"><big><big>-</big></big>1</th>
        <th width="7%"><big><big>-</big></big>2</th>
        <th width="7%"><big><big>-</big></big>3</th>
        <th width="7%"><big><big>-</big></big>4</th>
        <th width="7%"><big><big>-</big></big>5</th>
        <th width="7%"><big><big>-</big></big>6</th>
        <th width="7%"><big><big>-</big></big>7</th>
        <th width="7%"><big><big>-</big></big>8</th>
        <th width="7%"><big><big>-</big></big>9</th>
        <th width="7%"><big><big>-</big></big>A</th>
        <th width="7%"><big><big>-</big></big>B</th>
        <th width="7%"><big><big>-</big></big>C</th>
        <th width="7%"><big><big>-</big></big>D</th>
        <th width="7%"><big><big>-</big></big>E</th>
        <th width="7%"><big><big>-</big></big>F</th>
        <th width="7%">&nbsp;</th>
      </tr>
    </table>


    <br><A name="DETAIL">&nbsp;</A>
    <center>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Detailed Instruction Reference
      </font></h1></td></tr></table>
    </center>
    <br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="ADC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>ADC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       ADC #$A5       $69      2     2   </font>
  <font color="black">Zero Page       ADC $A5        $65      2     3   </font>
  <font color="black">Zero Page,X     ADC $A5,X      $75      2     4   </font>
  <font color="black">Absolute        ADC $A5B6      $6D      3     4   </font>
  <font color="black">Absolute,X      ADC $A5B6,X    $7D      3     4+  </font>
  <font color="black">Absolute,Y      ADC $A5B6,Y    $79      3     4+  </font>
  <font color="black">(Indirect,X)    ADC ($A5,X)    $61      2     6   </font>
  <font color="black">(Indirect),Y    ADC ($A5),Y    $71      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Add Memory to A with Carry</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><b>V</b></A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = A + M + P.C
  P.V = (A.7!=t.7) ? 1:0
  P.N = A.7
  P.Z = (t==0) ? 1:0
  IF (P.D)
    t = bcd(A) + bcd(M) + P.C
    P.C = (t>99) ? 1:0
  ELSE
    P.C = (t>255) ? 1:0
  A = t &amp; 0xFF                </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            There is no add-without-carry instruction!
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            As the result of ADC depends on the contents of the <a href="#FLG-C">Carry Flag (P.C)</A>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When performing "single precision" (or "8 bit") arithmetic it is often necessary to
            ensure that the <a href="#FLG-C">Carry Flag (P.C)</A> is CLEARed with a <a href="#CLC">CLC</A>
            command before the ADC is executed ...to ensure that the
            <a href="#FLG-C">Carry Flag (P.C)</A> has no bearing on the result.
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            CLEARing the <a href="#FLG-C">Carry Flag (P.C)</A> with a <a href="#CLC">CLC</A> command is
            normally necessary before the first stage of a "multiple precision" (or "more than 8 bit")
            addition.
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The action of ADC is dependant on the setting of <a href="#FLG-D">Decimal Flag (P.D)</A><br>
          </td></tr>
        </table></td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="AND">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>AND</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       AND #$A5       $29      2     2   </font>
  <font color="black">Zero Page       AND $A5        $25      2     2   </font>
  <font color="black">Zero Page,X     AND $A5,X      $35      2     3   </font>
  <font color="black">Absolute        AND $A5B6      $2D      3     4   </font>
  <font color="black">Absolute,X      AND $A5B6,X    $3D      3     4+  </font>
  <font color="black">Absolute,Y      AND $A5B6,Y    $39      3     4+  </font>
  <font color="black">(Indirect,X)    AND ($A5,X)    $21      2     6   </font>
  <font color="black">(Indirect),Y    AND ($A5),Y    $31      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Bitwise-AND A with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  A = A &amp; M
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary=""><tr>
  <td>
    <table summary="" border="1" cellpadding="5">
      <tr><td bgcolor="#ffffff"><pre>AND</pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
      <tr><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td></tr>
      <tr><td bgcolor="#ffffff"><pre> 1 </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
    </table>
  </td>
  <td width="10%"></td>
  <td>
    <table summary="" frame="box">
      <tr>
        <td><pre> 1 0 1 0 </pre></td>
        <td rowspan="2"><pre>AND </pre></td>
      </tr>
      <tr>
        <td><pre> 1 1 0 0 </pre></td>
      </tr>
      <tr>
        <td><pre>---------</pre></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><pre> 1 0 0 0 </pre></td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </td>
</tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="ASL">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>ASL</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Accumulator     ASL A          $0A      1     2   </font>
  <font color="black">Zero Page       ASL $A5        $06      2     5   </font>
  <font color="black">Zero Page,X     ASL $A5,X      $16      2     6   </font>
  <font color="black">Absolute        ASL $A5B6      $0E      3     6   </font>
  <font color="black">Absolute,X      ASL $A5B6,X    $1E      3     7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Arithmetic Shift Left</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.C = B.7
  B = (B << 1) &amp; $FE
  P.N = B.7
  P.Z = (B==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="" frame="none">
  <tr>
    <td><table summary="" frame="box"><tr><td><small>P.C</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.7</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.6</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.5</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.4</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.3</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.2</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.1</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.0</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>0</small></td></tr></table></td> <td><pre>&nbsp;</pre></td>
  </tr>
  <tr><td colspan="21"></td></tr>
  <tr><td colspan="21">
    <table summary="" align="center" frame="none" bgcolor="#ffffff">
      <tr>
        <td>&nbsp;Before:</td>
        <td><pre> P.C = <font color="black">?</font>   B = <font color="black">1 1 1 0  1 1 1 0</font> </pre></td>
      </tr>
      <tr>
        <td>&nbsp;After:</td>
        <td><pre> P.C = <font color="black">0</font>   B = <font color="black">1 1 0 1  1 1 0 0</font> </pre></td>
      </tr>
    </table>
  </td></tr>
</table>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            In my experience, this is NOT an "arithmetic" shift.<br>
            An Arithmetic shift <i>normally</i> preserves the Most Significant Bit (MSb) or "Sign bit"
            of the source value.<br>
            ASL does NOT do this on the 6502.<br>
            The 6502 places a copy of the sign from the result of a <i>Logical Shift Left</i>
            into the <a href="#FLG-N">sigN Flag (P.N)</A>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            This instruction would be better named as SLS (logical Shift Left and update Sign)
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BCC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BCC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BCC $A5        $90      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.C is CLEAR</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.C == 0) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0">
          <tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-C">Carry Flag (P.C)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BCS">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BCS</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BCS $A5        $B0      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.C is SET</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.C == 1) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-C">Carry Flag (P.C)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BEQ">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BEQ</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BEQ $A5        $F0      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.Z is SET</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.Z == 1) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-Z">Zero Flag (P.Z)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BIT">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BIT</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Zero Page       BIT $A5        $24      2     3   </font>
  <font color="black">Absolute        BIT $A5B6      $2C      3     4   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Test bits in A with M</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><b>V</b></A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = A &amp; M
  P.N = t.7
  P.V = t.6
  P.Z = (t==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td valign="top">
            The BIT instuction does NOT affect ANY register values.
          </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td valign="top">
            To perform a Branch if a bit-4 is SET:
          </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td valign="top">
<pre>
  LDA  0001'0000
  BIT  Mem
  BNE  lbl       </pre>
          </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td valign="top">
            To perform a Branch if a bit-4 is CLEAR:
          </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td valign="top">
<pre>
  LDA  0001'0000
  BIT  Mem
  BEQ  lbl       </pre>
          </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td valign="top">
            Care should be taken to ensure that  bits 6 &amp; 7 are the most frequently tested.<br>
            This way it is not necessary to preload A with the mask.<br><br>
<table summary="" bgcolor="#ffffff" border="1">
<tr><td valign="top">
<pre><font color="black"> IF (   bPeek(Mem)&amp;(1<<7)  ) GOTO lbl  </font></pre></td>
<td><pre><font color="black">  BIT  Mem <br>  BMI  lbl  </font></pre>
</td></tr>
<tr><td valign="top">
<pre><font color="black"> IF ( !(bPeek(Mem)&amp;(1<<7)) ) GOTO lbl  </font></pre></td>
<td><pre><font color="black">  BIT  Mem <br>  BPL  lbl  </font></pre>
</td></tr>
<tr><td valign="top">
<pre><font color="black"> IF (   bPeek(Mem)&amp;(1<<6)  ) GOTO lbl  </font></pre></td>
<td><pre><font color="black">  BIT  Mem <br>  BVS  lbl  </font></pre>
</td></tr>
<tr><td valign="top">
<pre><font color="black"> IF ( !(bPeek(Mem)&amp;(1<<6)) ) GOTO lbl  </font></pre></td>
<td><pre><font color="black">  BIT  Mem <br>  BVC  lbl  </font></pre>
</td></tr>
</table>
          </td></tr>
        </table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BMI">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BMI</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BMI $A5        $30      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.N is SET</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.N == 1) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-N">sigN Flag (P.N)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BNE">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BNE</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BNE $A5        $D0      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.Z is CLEAR</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.Z == 0) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-Z">Zero Flag (P.Z)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BPL">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BPL</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BPL $A5        $10      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.N is CLEAR</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.N == 0) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-N">sigN Flag (P.N)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BRK">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BRK</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         BRK            $00      1     7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Simulate Interrupt ReQuest (IRQ)</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  PC = PC + 1
  bPoke(SP,PC.h)
  SP = SP - 1
  bPoke(SP,PC.l)
  SP = SP - 1
  bPoke(SP, (P|$10) )
  SP = SP - 1
  l = bPeek($FFFE)
  h = bPeek($FFFF)<<8
  PC = h|l             </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The copy of the <A href="#FLG-B">Break Flag (P.B)</A> in the CPU is NOT changed (remains CLEAR).
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The copy of the <A href="#FLG-B">Break Flag (P.B)</A> which is placed on the <A href="#STACK">Stack</A> is SET.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            This simulates an <A href="#INT">Interrupt</A> in all but one respect:<br>
            The Return Address that is placed on the <A href="#STACK">Stack</A>, is incremented by one.<br>
            This means that the byte following a BRK command will NOT be executed upon Return.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            In the <A href="#INT">Interrupts</A> section, there is code to correct the return
            address error, but the code is bulky.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Another solution is to place a <A href="#NOP">NOP</A> after every BRK ...and then
            forget about this problem.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BVC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BVC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BVC $A5        $50      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.V is CLEAR</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.V == 0) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-V">oVerflow Flag (P.V)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="BVS">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>BVS</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Relative        BVS $A5        $70      2     2++ </font> </big></pre>
        <table summary="" align="center">
          <tr>
            <td rowspan="2" valign="top"><b><font color="black">++</font></b></td>
            <td><small>Add 1 (one) T-State if a the branch occurs <i>and</i> the destination address is on
                       the same <a href="#PAGE">Page</a></small></td>
          </tr><tr>
            <td><small>Add 2 (two) T-States if a the branch occurs <i>and</i> the destination address is on
            a different <a href="#PAGE">Page</a></small></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Branch iff P.V is SET</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  if (P.V == 1) GOTO (PC+M) </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#FLG-V">oVerflow Flag (P.V)</A> gives full details on this flag,
            including a comprehensive list of instructions which modify its value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            If a branch condition is false the <A href="#FLOW">Program Counter (PC)</A> is not affected and program execution
            continues at the instruction immediately after the Branch instrucion.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CLC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CLC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         CLC            $18      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Clear Carry Flag (P.C)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.C = 0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.C see:
            <a href="#ADC">ADC</A>, <a href="#SBC">SBC</A> and <a href="#FLG-C">Carry Flag (P.C)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CLD">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CLD</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         CLD            $D8      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Clear Decimal Flag (P.D)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><b>D</b></A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>x</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.D = 0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.D is SET aritmetic instructions will operate as <a href="#BCD">Binary Codec Decimal (BCD)</A>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.D is CLEAR aritmetic instructions will operate normally
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.D see:
            <a href="#ADC">ADC</A>, <a href="#SBC">SBC</A> and <a href="#FLG-D">Decimal Flag (P.D)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CLI">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CLI</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         CLI            $58      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Clear Interrupt (disable) Flag (P.I)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><b>I</b></A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.I = 0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.I is SET signals from the hardware <A href="#INT">IRQ</A> pin will be IGNORED
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.I is CLEAR a signal from the hardware <A href="#INT">IRQ</A> pin will cause program execution to continue from the
            <A href="#MEM_MAP">IRQ vector</A>, which is held little-endian at memory address #FFFE.  Full details of this vector
            can be found in <a href="#MEM_MAP">Memroy Map</A>.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.I see:
            <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A>
        </td>
      </tr></table>
    </tr></table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CLV">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CLV</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         CLV            $B8      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Clear oVerflow Flag (P.V)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><b>V</b></A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.V = 0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            There is NO instruction to SET the <A href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <b>P.V serves TWO purposes!</b><br>
            Arithmetic overflow and bit-6 from a <A href="#BIT">BIT</A> instruction.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.V see:
            <A href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CMP">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CMP</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       CMP #$A5       $C9      2     2   </font>
  <font color="black">Zero Page       CMP $A5        $C5      2     3   </font>
  <font color="black">Zero Page,X     CMP $A5,X      $D5      2     4   </font>
  <font color="black">Absolute        CMP $A5B6      $CD      3     4   </font>
  <font color="black">Absolute,X      CMP $A5B6,X    $DD      3     4+  </font>
  <font color="black">Absolute,Y      CMP $A5B6,Y    $D9      3     4+  </font>
  <font color="black">(Indirect,X)    CMP ($A5,X)    $C1      2     6   </font>
  <font color="black">(Indirect),Y    CMP ($A5),Y    $D1      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Compare A with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = A - M
  P.N = t.7
  P.C = (A>=M) ? 1:0
  P.Z = (t==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3">
          <table summary="" border="0">
          <tr><th colspan="4" align="left"><font color="black">Notes:</font></th></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td valign="top" colspan="2">
            A compare operation (CMP, <A href="#CPX">CPX</A> or <A href="#CPY">CPY</A>) is almost invariably followed by a <A href="#BRA">Conditional Branch</A>.
          </td></tr>
          <tr><td colspan="3">&nbsp;</td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td valign="top">
<table summary="" bgcolor="#ffffff" border="1" cellpadding="5">
  <tr align="center">
    <td><pre>&nbsp;</pre></td> <td><pre>P.N</pre></td> <td><pre>P.C</pre></td> <td><pre>P.Z</pre></td>
  </tr>
  <tr align="center">
    <td><pre>A < M</pre></td> <td><pre>1<font color="black">*</font></pre></td> <td><pre>0</pre></td> <td><pre>0</pre></td>
  </tr>
  <tr align="center">
    <td><pre>A = M</pre></td> <td><pre>0</pre></td> <td><pre>1</pre></td> <td><pre>1</pre></td>
  </tr>
  <tr align="center">
    <td><pre>A > M</pre></td> <td><pre>0<font color="black">*</font></pre></td> <td><pre>1</pre></td> <td><pre>0</pre></td>
  </tr>
</table>
          </td><td valign="top">
<table summary="" bgcolor="#ffffff" border="1">
  <tr>
    <td valign="top">&nbsp;</td>
    <th align="center">Signed</th align="center">
    <th align="center">Unsigned</th align="center">
  </tr><tr>
    <td valign="top"><pre><font color="black"> IF (r <  M)  GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BMI  lbl  </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BCC  lbl  </font></pre></td>
  </tr><tr>
    <td valign="top"><pre><font color="black"> IF (r <= M)  GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BMI  lbl<br>  BEQ  lbl </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BCC  lbl<br>  BEQ  lbl </font></pre></td>
  </tr><tr>
    <td valign="top"><pre><font color="black"> IF (r == M)  GOTO lbl  </font></pre></td>
    <td colspan="2"><pre><font color="black">         CMP  M<br>         BEQ  lbl  </font></pre></td>
  </tr><tr>
    <td valign="top"><pre><font color="black"> IF (r != M)  GOTO lbl  </font></pre></td>
    <td colspan="2"><pre><font color="black">         CMP  M<br>         BNE  lbl  </font></pre></td>
  </tr><tr>
    <td valign="top"><pre><font color="black"> IF (r >= M)  GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BPL  lbl  </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BCS  lbl  </font></pre></td>
  </tr><tr>
    <td valign="top"><pre><font color="black"> IF (r >  M)  GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BEQ  +2<br>  BPL  lbl </font></pre></td>
    <td><pre><font color="black">  CMP  M<br>  BEQ  +2<br>  BCS  lbl </font></pre></td>
  </tr>
</table>
      </td></tr>
      <tr><td width="1%" valign="top">&nbsp;</td>
      <td colspan="2">
        <font color="black">*</font>
        Only valid when comparing signed numbers (in the range -128..127)
      </td></tr>
      <tr><td width="1%" valign="top">#&nbsp;</td>
      <td colspan="2">
        "r" is any one of the three primary registers {A, X, Y}<br>
      </td></tr>
      <tr><td width="1%" valign="top">#&nbsp;</td>
      <td colspan="2">
        If A the intended register, then the CMP instruction must be used (as shown above).<br>
      </td></tr>
      <tr><td width="1%" valign="top">#&nbsp;</td>
      <td colspan="2">
        If X or Y is intended register, then the <A href="#CPX">CPX</a> or <A href="#CPY">CPY</a>
        instruction must be used
        (in place of the CMP instructions shown in the table above).<br>
      </td></tr>
            </table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CPX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CPX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       CPX #$A5       $E0      2     2   </font>
  <font color="black">Zero Page       CPX $A5        $E4      2     3   </font>
  <font color="black">Absolute        CPX $A5B6      $EC      3     4   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Compare X with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = X - M
  P.N = t.7
  P.C = (X>=M) ? 1:0
  P.Z = (t==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            See <A href="#CMP">CMP</A> instruction for Flag Table and <A href="#BRA">Conditional Branch</A> coding structures
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="CPY">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>CPY</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       CPY #$A5       $C0      2     2   </font>
  <font color="black">Zero Page       CPY $A5        $C4      2     3   </font>
  <font color="black">Absolute        CPY $A5B6      $CC      3     4   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Compare Y with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = Y - M
  P.N = t.7
  P.C = (Y>=M) ? 1:0
  P.Z = (t==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            See <A href="#CMP">CMP</A> instruction for Flag Table and <A href="#BRA">Conditional Branch</A> coding structures
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="DEC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>DEC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Zero Page       DEC $A5        $C6      2     5   </font>
  <font color="black">Zero Page,X     DEC $A5,X      $D6      2     6   </font>
  <font color="black">Absolute        DEC $A5B6      $CE      3     6   </font>
  <font color="black">Absolute,X      DEC $A5B6,X    $DE      3     7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Decrement Memory by one</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  M = (M - 1) &amp; $FF
  P.N = M.7
  P.Z = (M==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            DEC does NOT affect the <a href="#FLG-C">Carry Flag (P.C)</A> or  <a href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="DEX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>DEX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         DEX            $CA      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Decrement X by one</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  X = X - 1
  P.Z = (X==0) ? 1:0
  P.N = X.7          </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            DEX does NOT affect the <a href="#FLG-C">Carry Flag (P.C)</A> or  <a href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="DEY">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>DEY</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         DEY            $88      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Decrement Y by one</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  Y = Y - 1
  P.Z = (Y==0) ? 1:0
  P.N = Y.7          </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            DEY does NOT affect the <a href="#FLG-C">Carry Flag (P.C)</A> or  <a href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="EOR">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>EOR</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       EOR #$A5       $49      2     2   </font>
  <font color="black">Zero Page       EOR $A5        $45      2     3   </font>
  <font color="black">Zero Page,X     EOR $A5,X      $55      2     4   </font>
  <font color="black">Absolute        EOR $A5B6      $4D      3     4   </font>
  <font color="black">Absolute,X      EOR $A5B6,X    $5D      3     4+  </font>
  <font color="black">Absolute,Y      EOR $A5B6,Y    $59      3     4+  </font>
  <font color="black">(Indirect,X)    EOR ($A5,X)    $41      2     6   </font>
  <font color="black">(Indirect),Y    EOR ($A5),Y    $51      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Bitwise-EXclusive-OR A with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  A = A ^ M
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Known as XOR on most other platforms ...Either way, it is an EXclusive OR
            ...one or the other, but not both.
            </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td><td></td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary=""><tr>
  <td>
    <table summary="" border="1" cellpadding="5">
      <tr><td bgcolor="#ffffff"><pre>EOR</pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
      <tr><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
      <tr><td bgcolor="#ffffff"><pre> 1 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td></tr>
    </table>
  </td>
  <td width="10%"></td>
  <td>
    <table summary="" frame="box">
      <tr>
        <td><pre> 1 0 1 0 </pre></td>
        <td rowspan="2"><pre>EOR </pre></td>
      </tr>
      <tr>
        <td><pre> 1 1 0 0 </pre></td>
      </tr>
      <tr>
        <td><pre>---------</pre></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><pre> 0 1 1 0 </pre></td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </td>
</tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="INC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>INC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Zero Page       INC $A5        $E6      2     5   </font>
  <font color="black">Zero Page,X     INC $A5,X      $F6      2     6   </font>
  <font color="black">Absolute        INC $A5B6      $EE      3     6   </font>
  <font color="black">Absolute,X      INC $A5B6,X    $FE      3     7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Increment Memory by one</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  M = (M + 1) &amp; $FF
  P.N = M.7
  P.Z = (M==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            INC does NOT affect the <a href="#FLG-C">Carry Flag (P.C)</A> or  <a href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="INX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>INX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         INX            $E8      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Increment X by one</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  X = X + 1
  P.Z = (X==0) ? 1:0
  P.N = X.7          </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            INX does NOT affect the <a href="#FLG-C">Carry Flag (P.C)</A> or  <a href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="INY">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>INY</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         INY            $C8      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Increment Y by one</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  Y = Y + 1
  P.Z = (Y==0) ? 1:0
  P.N = Y.7          </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            INY does NOT affect the <a href="#FLG-C">Carry Flag (P.C)</A> or  <a href="#FLG-V">oVerflow Flag (P.V)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="JMP">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>JMP</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Absolute        JMP $A5B6      $4C      3     3  </font>
  <font color="black">Indirect        JMP ($A5B6)    $6C      3     5  </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">GOTO Address</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  PC = M </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="JSR">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>JSR</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Absolute        JSR $A5B6      $20      3     6   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Jump to SubRoutine</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = PC - 1
  bPoke(SP,t.h)
  SP = SP - 1
  bPoke(SP,t.l)
  SP = SP - 1
  PC = $A5B6    </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The current <A href="#FLOW">Program Counter (PC)</A> minus one (PC-1) is PUSHed onto the <A href="#STACK">Stack</A>,
            and then set to the specified value.
          </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            A Subroutine is normally terminated with an <a href="#RTS">RTS</A> instruction.
          </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="LDA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>LDA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       LDA #$A5       $A9      2     2   </font>
  <font color="black">Zero Page       LDA $A5        $A5      2     3   </font>
  <font color="black">Zero Page,X     LDA $A5,X      $B5      2     4   </font>
  <font color="black">Absolute        LDA $A5B6      $AD      3     4   </font>
  <font color="black">Absolute,X      LDA $A5B6,X    $BD      3     4+  </font>
  <font color="black">Absolute,Y      LDA $A5B6,Y    $B9      3     4+  </font>
  <font color="black">(Indirect,X)    LDA ($A5,X)    $A1      2     6   </font>
  <font color="black">(Indirect),Y    LDA ($A5),Y    $B1      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Load A with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  A = M
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="LDX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>LDX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       LDX #$A5       $A2      2     2   </font>
  <font color="black">Zero Page       LDX $A5        $A6      2     3   </font>
  <font color="black">Zero Page,Y     LDX $A5,Y      $B6      2     4   </font>
  <font color="black">Absolute        LDX $A5B6      $AE      2     4   </font>
  <font color="black">Absolute,Y      LDX $A5B6,Y    $BE      2     4+  </font></big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Load X with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  X = M
  P.N = X.7
  P.Z = (X==0) ? 1:0</pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="LDY">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>LDY</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       LDY #$A5       $A0      2     2   </font>
  <font color="black">Zero Page       LDY $A5        $A4      2     3   </font>
  <font color="black">Zero Page,X     LDY $A5,X      $B4      2     4   </font>
  <font color="black">Absolute        LDY $A5B6      $AC      2     4   </font>
  <font color="black">Absolute,X      LDY $A5B6,X    $BC      2     4+  </font></big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Load Y with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  Y = M
  P.N = Y.7
  P.Z = (Y==0) ? 1:0</pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="LSR">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>LSR</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Accumulator     LSR A          $4A      1     2   </font>
  <font color="black">Zero Page       LSR $A5        $46      2     5   </font>
  <font color="black">Zero Page,X     LSR $A5,X      $56      2     6   </font>
  <font color="black">Absolute        LSR $A5B6      $4E      3     6   </font>
  <font color="black">Absolute,X      LSR $A5B6,X    $5E      3     7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Logical Shift Right</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.N = 0
  P.C = B.0
  B = (B >> 1) &amp; $7F
  P.Z = (B==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="" frame="none">
  <tr>
    <td><table summary="" frame="box"><tr><td><small>0</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.7</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.6</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.5</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.4</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.3</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.2</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.1</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.0</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>P.C</small></td></tr></table></td>
  </tr>
  <tr><td colspan="19"></td></tr>
  <tr><td colspan="19">
    <table summary="" frame="none" align="center" bgcolor="#ffffff">
      <tr>
        <td>&nbsp;Before:</td>
        <td><pre> B = <font color="black">1 1 1 0  1 1 1 0</font>   P.C = <font color="black">?</font> </pre></td>
      </tr>
      <tr>
        <td>&nbsp;After:</td>
        <td><pre> B = <font color="black">0 1 1 1  0 1 1 1</font>   P.C = <font color="black">0</font> </pre></td>
      </tr>
    </table>
  </td></tr>
</table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="NOP">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>NOP</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         NOP            $EA      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">No OPeration</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  <i>~none~</i> </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            NOP achieves absolutely nothing.<br>
            But when it is finished you are 1 T-State closer to your grave.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            NOP can be used to reserve space in a program for future code.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Another frequent use of NOP is to patch out features of an existing program without
            the need for a full recompile.<br>
            ...The hackers favourite :)
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="ORA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>ORA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       ORA #$A5       $09      2     2   </font>
  <font color="black">Zero Page       ORA $A5        $05      2     2   </font>
  <font color="black">Zero Page,X     ORA $A5,X      $15      2     3   </font>
  <font color="black">Absolute        ORA $A5B6      $0D      3     4   </font>
  <font color="black">Absolute,X      ORA $A5B6,X    $1D      3     4+  </font>
  <font color="black">Absolute,Y      ORA $A5B6,Y    $19      3     4+  </font>
  <font color="black">(Indirect,X)    ORA ($A5,X)    $01      2     6   </font>
  <font color="black">(Indirect),Y    ORA ($A5),Y    $11      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Bitwise-OR A with Memory</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  A = A | M
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary=""><tr>
  <td>
    <table summary="" border="1" cellpadding="5">
      <tr><td bgcolor="#ffffff"><pre>OR </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
      <tr><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 0 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
      <tr><td bgcolor="#ffffff"><pre> 1 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td><td bgcolor="#ffffff"><pre> 1 </pre></td></tr>
    </table>
  </td>
  <td width="10%"></td>
  <td>
    <table summary="" frame="box">
      <tr>
        <td><pre> 1 0 1 0 </pre></td>
        <td rowspan="2"><pre>OR </pre></td>
      </tr>
      <tr>
        <td><pre> 1 1 0 0 </pre></td>
      </tr>
      <tr>
        <td><pre>---------</pre></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><pre> 1 1 1 0 </pre></td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </td>
</tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="PHA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>PHA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         PHA            $48      1     3   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">PusH A onto Stack</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  bPoke(SP,A)
  SP = SP - 1 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            You would be wise to take a little time to look at the notes for <A href="#JSR">JSR</A>
            and <A href="#RTS">RTS</A> and work out why the following code will crash your program:
            </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
          <table summary=""><tr>
          <td bgcolor="#ffffff"><pre>
         JSR   Subr
         ...
         ...
 Subr:   PHA
         RTS           </pre>
          </td></tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="PHP">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>PHP</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         PHP            $08      1     3   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">PusH P onto Stack</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  bPoke(SP,P)
  SP = SP - 1 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            A copy of the current <A href="#FLAGS">Processor Status Word (Flags)</A> is PUSHed onto the <A href="#STACK">Stack</A>.<br>
            This can be useful if you wish to preserve the current <A href="#FLAGS">Flags</A> state while a
            Subroutine is called.<br>
            This system is utilised automatically by the processor during an <A href="#INT">Interrupt Subroutine</A>.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            You may later copy the <A href="#FLAGS">Flags</A> back to P with the <A href="#PLP">PLP</A> instruction.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            You would be wise to take a little time to look at the notes for <A href="#JSR">JSR</A>
            and <A href="#RTS">RTS</A> and work out why the following code will crash your program:
            </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
          <table summary=""><tr>
          <td bgcolor="#ffffff"><pre>
         JSR   Subr
         ...
         ...
 Subr:   PHP
         RTS           </pre>
          </td></tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="PLA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>PLA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         PLA            $68      1     4   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">PulL from Stack to A</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  SP = SP + 1
  A = bPeek(SP)
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            You would be wise to take a little time to look at the notes for <A href="#JSR">JSR</A>
            and <A href="#RTS">RTS</A> and work out why the following code will crash your program:
            </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
          <table summary=""><tr>
          <td bgcolor="#ffffff"><pre>
         JSR   Subr
         ...
         ...
 Subr:   PLA
         RTS           </pre>
          </td></tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="PLP">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>PLP</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         PLP            $28      1     4   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">PulL from Stack to P</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><b>V</b></A></td>
          <td>-</td>
          <td><a href="#FLG-B"><b>B</b></A></td>
          <td><a href="#FLG-D"><b>D</b></A></td>
          <td><a href="#FLG-I"><b>I</b></A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  SP = SP + 1
  P = bPeek(SP)  </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The entry on the top of the <A href="#STACK">Stack</A> is placed in the <A href="#FLAGS">Processor Status Word (Flags)</A>.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            By definition this instruction can affect any or all <A href="#FLAGS">Flags</A> to known states.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            This instruction is normally only used to
            <table summary=""><tr><td width="1%" valign="top">#&nbsp;</td><td>
              Reverse a <A href="#PHA">PHA</A> instruction
            </td></tr><tr><td>
            <tr><td width="1%" valign="top">#&nbsp;</td><td>
              Test for the <A href="#FLG-B">Break Flag (P.B)</A> during an <A href="#INT">Interrupt SubRoutine</A>.
            </td></tr></table>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            You would be wise to take a little time to look at the notes for <A href="#JSR">JSR</A>
            and <A href="#RTS">RTS</A> and work out why the following code will crash your program:
            </td></tr>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
          <table summary=""><tr>
          <td bgcolor="#ffffff"><pre>
         JSR   Subr
         ...
         ...
 Subr:   PLA
         RTS           </pre>
          </td></tr></table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="ROL">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>ROL</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Accumulator     ROL A          $2A      1    2   </font>
  <font color="black">Zero Page       ROL $A5        $26      2    5   </font>
  <font color="black">Zero Page,X     ROL $A5,X      $36      2    6   </font>
  <font color="black">Absolute        ROL $A5B6      $2E      3    6   </font>
  <font color="black">Absolute,X      ROL $A5B6,X    $3E      3    7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">ROtate Left</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = B.7
  B = (B << 1) &amp; $FE
  B = B | P.C
  P.C = t
  P.Z = (B==0) ? 1:0
  P.N = B.7          </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="" frame="none">
  <tr>
    <td><pre>,-<-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>P.C</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.7</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.6</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.5</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.4</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.3</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.2</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.1</small></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.0</small></td></tr></table></td> <td><pre>-<-.</pre></td>
  </tr>
  <tr>
    <td><pre>`->-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="none"><tr><td><pre>-></pre></td></tr></table></td> <td><pre>->-'</pre></td>
  </tr>
  <tr><td colspan="19"></td></tr>
  <tr><td colspan="19">
    <table summary="" frame="none" align="center" bgcolor="#ffffff">
      <tr>
        <td>&nbsp;Before:</td>
        <td><pre> P.C = <font color="black">1</font>   B = <font color="black">0 1 1 0  1 1 1 0</font> </pre></td>
      </tr>
      <tr>
        <td>&nbsp;After:</td>
        <td><pre> P.C = <font color="black">0</font>   B = <font color="black">1 1 0 1  1 1 0 1</font> </pre></td>
      </tr>
    </table>
  </td></tr>
</table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="ROR">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>ROR</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Accumulator     ROR A          $6A      1     2   </font>
  <font color="black">Zero Page       ROR $A5        $66      2     5   </font>
  <font color="black">Zero Page,X     ROR $A5,X      $76      2     6   </font>
  <font color="black">Absolute        ROR $A5B6      $6E      3     6   </font>
  <font color="black">Absolute,X      ROR $A5B6,X    $7E      3     7   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">ROtate Right</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  t = B.0
  B = (B >> 1) &amp; $7F
  B = B | ((P.C) ? $80:$00)
  P.C = t
  P.Z = (B==0) ? 1:0
  P.N = B.7                 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="" frame="none">
  <tr>
    <td><pre>,->-</pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.7</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.6</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.5</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.4</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.3</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.2</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.1</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>b.0</small></td></tr></table></td> <td><pre>-></pre></td>
    <td><table summary="" frame="box"><tr><td><small>P.C</small></td></tr></table></td> <td><pre>->-.</pre></td>
  </tr>
  <tr>
    <td><pre>`-<-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre><-</pre></td>
    <td><table summary="" frame="none"><tr><td><pre><-</pre></td></tr></table></td> <td><pre>-<-'</pre></td>
  </tr>
  <tr><td colspan="19"></td></tr>
  <tr><td colspan="19">
    <table summary="" frame="none" align="center" bgcolor="#ffffff">
      <tr>
        <td>&nbsp;Before:</td>
        <td><pre> B = <font color="black">0 1 1 0  1 1 1 0</font>   P.C = <font color="black">1</font> </pre></td>
      </tr>
      <tr>
        <td>&nbsp;After:</td>
        <td><pre> B = <font color="black">1 0 1 1  0 1 1 1</font>   P.C = <font color="black">0</font> </pre></td>
      </tr>
    </table>
  </td></tr>
</table>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="RTI">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>RTI</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         RTI            $40      1     6   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">ReTurn from Interrupt</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><b>V</b></A></td>
          <td>-</td>
          <td><a href="#FLG-B"><b>B</b></A></td>
          <td><a href="#FLG-D"><b>D</b></A></td>
          <td><a href="#FLG-I"><b>I</b></A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  SP = SP - 1
  P = bPeek(SP)
  SP = SP - 1
  l = bPeek(SP)
  SP = SP - 1
  h = bPeek(SP)<<8
  PC = h|l         </pre>
      </td></tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            <A href="#INT">Interrupts</A> are normally triggered externally by hardware devices via
            the <A href="#INT">IRQ</A> pin on the 6502 itself.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Note that unlike <A href="#RTS">RTS</A>, RTI does NOT add one to the destination before
            placing it in the <A href="#FLOW">Program Counter (PC)</A>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            An <A href="#INT">Interrupt</A> may be simulated by a <A href="#BRK">BRK</A> instruction<br>
            <font color="black">**WARNING**</font>
            Make sure you read up on <A href="#BRK">BRK</A> before using it - it's weird!
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="RTS">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>RTS</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         RTS            $60      1     6   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">ReTurn from Subroutine</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  SP = SP + 1
  l = bPeek(SP)
  SP = SP + 1
  h = bPeek(SP)<<8
  PC = (h|l) +1    </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            A word (16-bits) is PulLed from the top of the <A href="#STACK">Stack</A>; this value is then incremented
            by one and placed in the <A href="#FLOW">Program Counter (PC)</A>.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            RTS is normally used to return from a Subroutine called by the <A href="#JSR">JSR</A>
            instruction.<br>
            This way they act as the classic "GOSUB" and "RETURN" statements.
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="SBC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>SBC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Immediate       SBC #$A5       $E9      2     2   </font>
  <font color="black">Zero Page       SBC $A5        $E5      2     3   </font>
  <font color="black">Zero Page,X     SBC $A5,X      $F5      2     4   </font>
  <font color="black">Absolute        SBC $A5B6      $ED      3     4   </font>
  <font color="black">Absolute,X      SBC $A5B6,X    $FD      3     4+  </font>
  <font color="black">Absolute,Y      SBC $A5B6,Y    $F9      3     4+  </font>
  <font color="black">(Indirect,X)    SBC ($A5,X)    $E1      2     6   </font>
  <font color="black">(Indirect),Y    SBC ($A5),Y    $F1      2     5+  </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Subtract Memory from A with Borrow</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><b>V</b></A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  IF (P.D)
    t = bcd(A) - bcd(M) - !P.C
    P.V = (t>99 OR t<0) ? 1:0
  ELSE
    t = A - M - !P.C
    P.V = (t>127 OR t<-128) ? 1:0
  P.C = (t>=0) ? 1:0
  P.N = t.7
  P.Z = (t==0) ? 1:0
  A = t &amp; 0xFF                    </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            There is no subtract-without-carry instruction!
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            As the result of SBC depends on the contents of the <a href="#FLG-C">Carry Flag (P.C)</A><br>
            When performing "single precision" (or "8 bit") arithmetic it is often necessary to
            ensure that the <a href="#FLG-C">Carry Flag (P.C)</A> is SET with an <a href="#SEC">SEC</A>
            command before the subtraction is executed.<br>
            The upshot of the <a href="#SEC">SEC</A>
            is to ensure that the <a href="#FLG-C">Carry Flag (P.C)</A> has no bearing on the
            result.
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            SETting the <a href="#FLG-C">Carry Flag (P.C)</A> with an <a href="#SEC">SEC</A> command is
            normally necessary before the first stage of a "multiple precision" (or "more than 8 bit")
            subtraction.
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The action of SBC is dependant on the setting of <a href="#FLG-D">Decimal Flag (P.D)</A>
          </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="SEC">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>SEC</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         SEC            $38      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Set Carry flag (P.C)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><b>C</b></A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.C = 1 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.C see:
            <a href="#ADC">ADC</A>, <a href="#SBC">SBC</A> and <a href="#FLG-C">Carry Flag (P.C)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="SED">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>SED</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         CLD            $F8      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Set Binary Coded Decimal Flag (P.D)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><b>D</b></A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>x</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.D = 1 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.D is SET aritmetic instructions will operate as <a href="#BCD">Binary Codec Decimal (BCD)</A>
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.D is CLEAR aritmetic instructions will operate normally
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.D see:
            <a href="#ADC">ADC</A>, <a href="#SBC">SBC</A> and <a href="#FLG-D">Decimal Flag (P.D)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="SEI">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>SEI</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <x>Implied         SEI            $78      1     2    </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Set Interrupt (disable) Flag (P.I)</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><b>I</b></A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  P.I = 1 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.I is SET signals from the <A href="#INT">hardware IRQ pin</A> will be IGNORED
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            When P.I is CLEAR a signal from the <A href="#INT">hardware IRQ pin</A> will cause program execution to continue from the
            <A href="#MEM_MAP">IRQ vector</A>, which is held little-endian at memory address #FFFE.  Full details of this vector
            can be found in <a href="#MEM_MAP">Memroy Map</A>.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            For more information on P.I see:
            <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="STA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>STA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Zero Page       STA $A5        $85      2     3   </font>
  <font color="black">Zero Page,X     STA $A5,X      $95      2     4   </font>
  <font color="black">Absolute        STA $A5B6      $8D      3     4   </font>
  <font color="black">Absolute,X      STA $A5B6,X    $9D      3     5   </font>
  <font color="black">Absolute,Y      STA $A5B6,Y    $99      3     5   </font>
  <font color="black">(Indirect,X)    STA ($A5,X)    $81      2     6   </font>
  <font color="black">(Indirect),Y    STA ($A5),Y    $91      2     6   </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Store A in Memory</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  M = A </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="STX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>STX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Zero Page       STX $A5        $86      2     3   </font>
  <font color="black">Zero Page,Y     STX $A5,Y      $96      2     4   </font>
  <font color="black">Absolute        STX $A5B6      $8E      3     4   </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Store X in Memory</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  M = X  </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="STY">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>STY</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Zero Page       STY $A5        $84      2     3   </font>
  <font color="black">Zero Page,X     STY $A5,X      $94      2     4   </font>
  <font color="black">Absolute        STY $A5B6      $8C      3     4   </font> </big></pre>
        <center><b><font color="black">+</font></b><small>&nbsp;&nbsp;Add 1 (one) T-State if a <a href="#PAGE">Page Boundary</a> is crossed</small></center><br>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Store Y in Memory</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  M = Y  </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="TAX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>TAX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         TAX            $AA      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Transfer A to X</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  X = A
  P.N = X.7
  P.Z = (X==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="TAY">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>TAY</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         TAY            $A8      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Transfer A to Y</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  Y = A
  P.N = Y.7
  P.Z = (Y==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="TSX">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>TSX</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         TSX            $BA      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Transfer Stack Pointer to X</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  X = SP
  P.N = X.7
  P.Z = (X==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            TSX is the only way to retrieve the current position of the <A href="#STACK">Stack Pointer</A>.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The <A href="#STACK">Stack</A> can ONLY exist in Page 1 of memory (addresses $01'00..$01'FF)
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="TXA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>TXA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         TXA            $8A      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Transfer X to A</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  A = X
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="TXS">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>TXS</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         TXS            $9A      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Transfer X to Stack Pointer</td></tr>
      <tr>
        <td align="center"><font color="black"><s>Flags Affected</s>:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><x>n</A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><x>z</A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  SP = X </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            Although many instructions modify the value of the <A href="#STACK">Stack Pointer</A>,
            TXS is the only way to set it to a specified value.
            </td></tr>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            The <A href="#STACK">Stack</A> can ONLY exist in Page 1 of memory (addresses $01'00..$01'FF)<br>
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <a name="TYA">&nbsp;</A>
    <table summary="" border="1" width="80%" align="center" bgcolor="#ffffff">
      <tr>
        <td width="30%" align="center" colspan="2" bgcolor="#ffffff"><big><big><b>TYA</b></big></big></td>
        <td rowspan="4" valign="top"><pre><big>
  <font color="black"><u>Address Mode    Syntax        Opcode  I-Len  T-Cnt</u></font>&nbsp;&nbsp;<br>
  <font color="black">Implied         TYA            $98      1     2   </font> </big></pre>
        </td>
      </tr>
      <tr><td align="center" colspan="2">Transfer Y to A</td></tr>
      <tr>
        <td align="center"><font color="black">Flags Affected:</font></td>
        <td align="center"><table summary="" border="1"><tr>
          <td><a href="#FLG-N"><b>N</b></A></td>
          <td><a href="#FLG-V"><x>v</A></td>
          <td>-</td>
          <td><a href="#FLG-B"><x>b</A></td>
          <td><a href="#FLG-D"><x>d</A></td>
          <td><a href="#FLG-I"><x>i</A></td>
          <td><a href="#FLG-Z"><b>Z</b></A></td>
          <td><a href="#FLG-C"><x>c</A></td>
        </tr></table></td>
      </tr>
      <tr><td colspan="2" valign="top" bgcolor="#ffffff"><pre>
<i>Logic:</i>
  A = Y
  P.N = A.7
  P.Z = (A==0) ? 1:0 </pre>
      </td> </tr>
      <tr>
        <td colspan="3"><table summary="" border="0"><tr><th colspan="2" align="left"><font color="black"><b>Notes:</b></font></th>
          <tr><td width="1%" valign="top">#&nbsp;</td><td>
            None
            </td></tr></table>
        </td>
      </tr>
    </table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="QUICK">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      6502 Instruction set Quick Reference
      </font></h1></td></tr></table>
    </center>
    <br><br>

<table summary="" frame="box" align="center"><tr><td>
<pre>
 <A href="#ADC">ADC</A>   <A href="#AND">AND</A>   <A href="#ASL">ASL</A>
 <A href="#BCC">BCC</A>   <A href="#BCS">BCS</A>   <A href="#BEQ">BEQ</A>   <A href="#BIT">BIT</A>   <A href="#BMI">BMI</A>   <A href="#BNE">BNE</A>   <A href="#BPL">BPL</A>   <A href="#BRK">BRK</A>   <A href="#BVC">BVC</A>   <A href="#BVS">BVS</A>&nbsp;
 <A href="#CLC">CLC</A>   <A href="#CLD">CLD</A>   <A href="#CLI">CLI</A>   <A href="#CLV">CLV</A>   <A href="#CMP">CMP</A>   <A href="#CPX">CPX</A>   <A href="#CPY">CPY</A>
 <A href="#DEC">DEC</A>   <A href="#DEX">DEX</A>   <A href="#DEY">DEY</A>
 <A href="#EOR">EOR</A>
 <A href="#INC">INC</A>   <A href="#INX">INX</A>   <A href="#INY">INY</A>
 <A href="#JMP">JMP</A>   <A href="#JSR">JSR</A>
 <A href="#LDA">LDA</A>   <A href="#LDX">LDX</A>   <A href="#LDY">LDY</A>   <A href="#LSR">LSR</A>
 <A href="#NOP">NOP</A>
 <A href="#ORA">ORA</A>
 <A href="#PHA">PHA</A>   <A href="#PHP">PHP</A>   <A href="#PLA">PLA</A>   <A href="#PLP">PLP</A>
 <A href="#ROL">ROL</A>   <A href="#ROR">ROR</A>   <A href="#RTI">RTI</A>   <A href="#RTS">RTS</A>
 <A href="#SBC">SBC</A>   <A href="#SEC">SEC</A>   <A href="#SED">SED</A>   <A href="#SEI">SEI</A>   <A href="#STA">STA</A>   <A href="#STX">STX</A>   <A href="#STY">STY</A>
 <A href="#TAX">TAX</A>   <A href="#TAY">TAY</A>   <A href="#TSX">TSX</A>   <A href="#TXA">TXA</A>   <A href="#TXS">TXS</A>   <A href="#TYA">TYA</A>
</pre>
</td></tr></table>
<br>


<table summary="" align="center">
<tr><td>
<pre>
  <A href="#ADC">ADC - Add Memory to A with Carry</A>
  <A href="#AND">AND - Bitwise-and A with Memory</A>
  <A href="#ASL">ASL - Arithmetic Shift Left</A>
  <A href="#BCC">BCC - Branch iff Carry flag (P.C) is CLEAR</A>
  <A href="#BCS">BCS - Branch iff Carry flag (P.C) is SET</A>
  <A href="#BEQ">BEQ - Branch iff Carry flag (P.Z) is SET</A>
  <A href="#BIT">BIT - Test bits in A with M</A>
  <A href="#BMI">BMI - Branch iff sigN flag (P.N) is SET</A>
  <A href="#BNE">BNE - Branch iff Carry flag (P.Z) is CLEAR</A>
  <A href="#BPL">BPL - Branch iff sigN flag (P.N) is CLEAR</A>
  <A href="#BRK">BRK - Simulate IRQ</A>
  <A href="#BVC">BVC - Branch iff oVerflow flag (P.V) is CLEAR</A>
  <A href="#BVS">BVS - Branch iff oVerflow flag (P.V) is SET</A>
  <A href="#CLC">CLC - Clear Carry flag (P.C)</A>
  <A href="#CLD">CLD - Clear Decimal flag (P.D)</A>
  <A href="#CLI">CLI - Clear Interrupt flag (P.I)</A>
  <A href="#CLV">CLV - Clear oVerflow flag (P.V)</A>
  <A href="#CMP">CMP - Compare A with Memory</A>
  <A href="#CPX">CPX - Compare X with Memory</A>
  <A href="#CPY">CPY - Compare Y with Memory</A>
  <A href="#DEC">DEC - Decrement Memory by one</A>
  <A href="#DEX">DEX - Decrement X by one</A>
  <A href="#DEY">DEY - Decrement Y by one</A>
  <A href="#EOR">EOR - Bitwise-exclusive-or A with Memory</A>
  <A href="#INC">INC - Increment Memory by one</A>
  <A href="#INX">INX - Increment X by one</A>
  <A href="#INY">INY - Increment Y by one</A>
  <A href="#JMP">JMP - GOTO Address</A>
</pre>
</td><td>
<pre>
  <A href="#JSR">JSR - Jump to SubRoutine</A>
  <A href="#LDA">LDA - Load A with Memory</A>
  <A href="#LDX">LDX - Load X with Memory</A>
  <A href="#LDY">LDY - Load Y with Memory</A>
  <A href="#LSR">LSR - Logical Shift Right</A>
  <A href="#NOP">NOP - No OPeration</A>
  <A href="#ORA">ORA - Bitwise-or A with Memory</A>
  <A href="#PHA">PHA - PusH A onto stack</A>
  <A href="#PHP">PHP - PusH P onto stack</A>
  <A href="#PLA">PLA - PulL A from stack</A>
  <A href="#PLP">PLP - PulL P from stack</A>
  <A href="#ROL">ROL - ROtate Left</A>
  <A href="#ROR">ROR - ROtate Right</A>
  <A href="#RTI">RTI - ReTurn from Interrupt</A>
  <A href="#RTS">RTS - ReTurn from Subroutine</A>
  <A href="#SBC">SBC - Subtract Memory from A with Borrow</A>
  <A href="#SEC">SEC - Set Carry flag (P.C)</A>
  <A href="#SED">SED - Set Decimal flag (P.D)</A>
  <A href="#SEI">SEI - Set Interrupt flag (P.I)</A>
  <A href="#STA">STA - Store A in Memory</A>
  <A href="#STX">STX - Store X in Memory</A>
  <A href="#STY">STY - Store Y in Memory</A>
  <A href="#TAX">TAX - Transfer A to X</A>
  <A href="#TAY">TAY - Transfer A to Y</A>
  <A href="#TSX">TSX - Transfer Stack Pointer to X</A>
  <A href="#TXA">TXA - Transfer X to A</A>
  <A href="#TXS">TXS - Transfer X to Stack Pointer</A>
  <A href="#TYA">TYA - Transfer Y to A</A>
</pre>
</td></tr>
</table>



<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="BY_PRP">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Instruction set by Purpose
      </font></h1></td></tr></table>
    </center>
    <br><br>

<table summary="" align="center" frame="box"><tr><td>
<pre>
 <A href="#IP-ACC">ACCUMULATOR</A>                 <A href="#IP-MATH">ARITHMETIC</A>                      <A href="#IP-STK">STACK</A>
   Arithmetic                  Accumulator                     Setup
   Memory Storage              Index X                         Implied Interaction
   Register Storage            Index Y                         Direct Interaction
   Bitwise Logic               Memory

 <A href="#IP-IDX">INDEX REGISTERS</A>             <A href="#IP-BIT">BITWISE LOGIC</A>                   <A href="#IP-FLOW">FLOW CONTROL</A>
   Index X                     Shifts &amp; Rotates                Comparisons
     Arithmetic                Comparisons                     Conditional Branches
     Memory Storage            Processor Status Flags          GOTO &amp; GOSUB
     Register Storage
   Index Y                                                   <A href="#IP-MISC">MISCELLANEOUS</A>
     Arithmetic
     Memory Storage
     Register Storage                                                               </pre>
</td></tr></table>
<br>

<center>
Where an instruction can be classified into more than one group, it is listed multiple times.
</center>
<br>
<pre>
<a name="IP-ACC"><big><u>ACCUMULATOR</u></big></a>
  Arithmetic
    <A href="#ADC">ADC - Add Memory to A with Carry</A>
    <A href="#SBC">SBC - Subtract Memory from A with Borrow</A>
  Memory Storage
    <A href="#LDA">LDA - Load A with Memory</A>
    <A href="#STA">STA - Store A in Memory</A>
    <A href="#PHA">PHA - PusH A onto stack</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#PLA">PLA - PulL A from stack</A> <font color="black"><b><small>(pull <-)</small></b></font>
  Register Storage
    <A href="#TXA">TXA - Transfer X to A</A>
    <A href="#TAX">TAX - Transfer A to X</A>
    <A href="#TYA">TYA - Transfer Y to A</A>
    <A href="#TAY">TAY - Transfer A to Y</A>
  Bitwise Logic
    <A href="#AND">AND - Bitwise-and A with Memory</A>
    <A href="#EOR">EOR - Bitwise-exclusive-or A with Memory</A>
    <A href="#ORA">ORA - Bitwise-or A with Memory</A>
    <A href="#ASL">ASL - Arithmetic Shift Left</A>
    <A href="#LSR">LSR - Logical Shift Right</A>
    <A href="#ROL">ROL - ROtate Left</A>
    <A href="#ROR">ROR - ROtate Right</A>


<a name="IP-IDX"><big><u>INDEX REGISTERS</u></big></a>
  Index X
    Arithmetic
      <A href="#INX">INX - Increment X by one</A>
      <A href="#DEX">DEX - Decrement X by one</A>
    Memory Storage
      <A href="#LDX">LDX - Load X with Memory</A>
      <A href="#STX">STX - Store X in Memory</A>
    Register Storage
      <A href="#TAX">TAX - Transfer A to X</A>
      <A href="#TXA">TXA - Transfer X to A</A>
      <A href="#TSX">TSX - Transfer Stack Pointer to X</A>
      <A href="#TXS">TXS - Transfer X to Stack Pointer</A>
  Index Y
    Arithmetic
      <A href="#INY">INY - Increment Y by one</A>
      <A href="#DEY">DEY - Decrement Y by one</A>
    Memory Storage
      <A href="#LDY">LDY - Load Y with Memory</A>
      <A href="#STY">STY - Store Y in Memory</A>
    Register Storage
      <A href="#TAY">TAY - Transfer A to Y</A>
      <A href="#TYA">TYA - Transfer Y to A</A>


<a name="IP-MATH"><big><u>ARITHMETIC</u></big></a>
  Accumulator
    <A href="#ADC">ADC - Add Memory to A with Carry</A>
    <A href="#SBC">SBC - Subtract Memory from A with Borrow</A>
    <A href="#ASL">ASL - Arithmetic Shift Left</A>
    <A href="#LSR">LSR - Logical Shift Right</A>
  Index X
    <A href="#INX">INX - Increment X by one</A>
    <A href="#DEX">DEX - Decrement X by one</A>
  Index Y
    <A href="#INY">INY - Increment Y by one</A>
    <A href="#DEY">DEY - Decrement Y by one</A>
  Memory
    <A href="#DEC">DEC - Decrement Memory by one</A>
    <A href="#INC">INC - Increment Memory by one</A>
    <A href="#ASL">ASL - Arithmetic Shift Left</A>
    <A href="#LSR">LSR - Logical Shift Right</A>


<a name="IP-BIT"><big><u>BITWISE LOGIC</u></big></a>
  Shifts &amp; Rotates
    <A href="#ASL">ASL - Arithmetic Shift Left</A>
    <A href="#LSR">LSR - Logical Shift Right</A>
    <A href="#ROL">ROL - ROtate Left</A>
    <A href="#ROR">ROR - ROtate Right</A>
  Comparisons
    <A href="#BIT">BIT - Test bits in A with M</A>
  <A href="#FLAGS">Processor Status Word (Flags) (P.?)</A>
    <A href="#FLG-N">P.N : sigN Flag (a.k.a. "S" Sign Flag)</A>
      There are no instructions to directly SET or CLEAR P.N
    <A href="#FLG-V">P.V : oVerflow Flag</A>
      There is no instruction to directly SET P.V
      <A href="#CLV">CLV - Clear oVerflow flag (P.V)</A>
    <A href="#FLG-B">P.B : Break Flag</A>
      <A href="#BRK">BRK - Simulate IRQ</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#FLG-D">P.D : binary coded Decimal Flag</A>
      <A href="#SED">SED - Set Decimal flag (P.D)</A>
      <A href="#CLD">CLD - Clear Decimal flag (P.D)</A>
    <A href="#FLG-I">P.I : Interrupt (disable) Flag</A>
      <A href="#SEI">SEI - Set Interrupt flag (P.I)</A>
      <A href="#CLI">CLI - Clear Interrupt flag (P.D)</A>
    <A href="#FLG-Z">P.Z : Zero Flag</A>
      There are no instructions to directly affect P.Z
    <A href="#FLG-C">P.C : Carry Flag</A>
      <A href="#SEC">SEC - Set Carry flag (P.C)</A>
      <A href="#CLC">CLC - Clear Carry flag (P.C)</A>

<a name="IP-STK"><big><u>STACK</u></big></a>
  Setup
    <A href="#TSX">TSX - Transfer Stack Pointer to X</A>
    <A href="#TXS">TXS - Transfer X to Stack Pointer</A>
  Implied Interaction
    <A href="#JSR">JSR - Jump to SubRoutine</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#RTS">RTS - ReTurn from Subroutine</A> <font color="black"><b><small>(pull <-)</small></b></font>
    <A href="#BRK">BRK - Simulate IRQ</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#RTI">RTI - ReTurn from Interrupt</A> <font color="black"><b><small>(pull <-)</small></b></font>
  Direct Interaction
    <A href="#PHA">PHA - PusH A onto stack</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#PHP">PHP - PusH P onto stack</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#PLA">PLA - PulL A from stack</A> <font color="black"><b><small>(pull <-)</small></b></font>
    <A href="#PLP">PLP - PulL P from stack</A> <font color="black"><b><small>(pull <-)</small></b></font>

<a name="IP-FLOW"><big><u>FLOW CONTROL</u></big></a>
  Comparisons
    <A href="#BIT">BIT - Test bits in A with M</A>
    <A href="#CMP">CMP - Compare A with Memory</A>
    <A href="#CPX">CPX - Compare X with Memory</A>
    <A href="#CPY">CPY - Compare Y with Memory</A>
  Conditional Branches
    The is no <b>un</b>conditional Branch instruction.
    <A href="#BCC">BCC - Branch iff Carry flag (P.C) is CLEAR</A>
    <A href="#BCS">BCS - Branch iff Carry flag (P.C) is SET</A>
    <A href="#BEQ">BEQ - Branch iff Carry flag (P.Z) is SET</A>
    <A href="#BMI">BMI - Branch iff sigN flag (P.N) is SET</A>
    <A href="#BNE">BNE - Branch iff Carry flag (P.Z) is CLEAR</A>
    <A href="#BPL">BPL - Branch iff sigN flag (P.N) is CLEAR</A>
    <A href="#BVC">BVC - Branch iff oVerflow flag (P.V) is CLEAR</A>
    <A href="#BVS">BVS - Branch iff oVerflow flag (P.V) is SET</A>
  GOTO &amp; GOSUB
    <A href="#JMP">JMP - GOTO Address</A>
    <A href="#JSR">JSR - Jump to SubRoutine</A>
    <A href="#RTS">RTS - ReTurn from Subroutine</A>
    <A href="#BRK">BRK - Simulate IRQ</A> <font color="black"><b><small>(push ->)</small></b></font>
    <A href="#RTI">RTI - ReTurn from Interrupt</A> <font color="black"><b><small>(pull <-)</small></b></font>

<a name="IP-MISC"><big><u>MISCELLANEOUS</u></big></a>
  <A href="#NOP">NOP - No OPeration</A>
</pre>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="FLAGS">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Processor Status Word (Flags)
      </font></h1></td></tr></table>
    </center>
    <br><br>

Called "F" for Flags on many other machines, the 6502 calls these indicators "P" for Processor Status Word.<br>
And way back in those days a "word" was "8 bits" ...deal with it ;)<br>
<br>
Of the eight available bits in the PSW, seven are used:<br>
<br>
<table summary="" border="0" bgcolor="#ffffff" cellpadding="10">
<tr><td valign="top"><pre>
bit 7  <A href="#FLG-N">P.N</A>  Negative<font color="black">*</font>
bit 6  <A href="#FLG-V">P.V</A>  oVerflow
bit 5   -   unused
bit 4  <A href="#FLG-B">P.B</A>  BRK was executed

bit 3  <A href="#FLG-D">P.D</A>  enable binary coded Decimal
bit 2  <A href="#FLG-I">P.I</A>  block <A href="#INT">IRQ Interrupts</A>
bit 1  <A href="#FLG-Z">P.Z</A>  Zero
bit 0  <A href="#FLG-C">P.C</A>  Carry
</pre></td>
<td bgcolor="#ffffff">&nbsp;</td>
<td><pre>
Bit no.:  7  6  5  4  3  2  1  0
Flag ID:  <A href="#FLG-N">N</A>  <A href="#FLG-V">V</A>  -  <A href="#FLG-B">B</A>  <A href="#FLG-D">D</A>  <A href="#FLG-I">I</A>  <A href="#FLG-Z">Z</A>  <A href="#FLG-C">C</A>
          |  |     |  |  |  |  |
          |  |     |  |  |  |  +-- Carry
          |  |     |  |  |  +-- Zero
          |  |     |  |  +-- block <A href="#INT">IRQ Interrupts</A>
          |  |     |  +-- enable binary coded Decimal
          |  |     +-- BRK was executed
          |  |
          |  +-- oVerflow
          +-- Negative<font color="black">*</font>
</pre></td></tr>
<tr><td colspan="3">
<center><pre><font color="black">*</font> The Negative flag is often referred to as P.S the "S"ign flag</pre></center>
</td></tr>
</table>

<br>

<pre>
  <A href="#FLG-N">P.N : sigN Flag</A>
  <A href="#FLG-V">P.V : oVerflow Flag</A>
  <A href="#FLG-B">P.B : Break Flag</A>
  <A href="#FLG-D">P.D : Decimal Flag</A>
      <A href="#BCD">Binary Coded Decimal (BCD)</A>
  <A href="#FLG-I">P.I : Interrupt (disable) Flag</A>
  <A href="#FLG-Z">P.Z : Zero Flag</A>
  <A href="#FLG-C">P.C : Carry Flag</A>
</pre>

<table summary="" border="0">
<tr><td colspan="2">
<A name="FLG-N">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
sigN Flag (P.N)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
Also known as P.S (Sign flag) in many documents.
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions can affect P.N:
</td></tr>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#ADC">ADC</A>, <A href="#SBC">SBC</A>, <A href="#INC">INC</A>, <A href="#INX">INX</A>, <A href="#INY">INY</A>, <A href="#DEC">DEC</A>, <A href="#DEX">DEX</A>, <A href="#DEY">DEY</A>
<A href="#AND">AND</A>, <A href="#EOR">EOR</A>, <A href="#ORA">ORA</A>, <A href="#BIT">BIT</A>, <A href="#CMP">CMP</A>, <A href="#CPX">CPX</A>, <A href="#CPY">CPY</A>
<A href="#ASL">ASL</A>, <A href="#LSR">LSR</A>, <A href="#ROL">ROL</A>, <A href="#ROR">ROR</A>
<A href="#LDA">LDA</A>, <A href="#LDX">LDX</A>, <A href="#LDY">LDY</A>
<A href="#TAX">TAX</A>, <A href="#TAY">TAY</A>, <A href="#TSX">TSX</A>, <A href="#TXA">TXA</A>, <A href="#TYA">TYA</A>
<A href="#PLA">PLA</A>, <A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions depend on P.N:
</td></tr>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#BMI">BMI</A>, <A href="#BPL">BPL</A>
</pre>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
There are NO instructions to directly SET or CLEAR P.N
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>

  <table summary="" border="0" cellpadding="0"><tr><td width="1%" valign="top" colspan="2">
    <b>P.N serves TWO purposes</b>
    </td></tr>

    <tr><td width="1%" valign="top"><font color="black">1)</font>&nbsp;</td><td>
    To signify the sigN of the last mathematical or bitwise operation.
    </td></tr>
    <tr><td width="1%" valign="top">&nbsp;</td><td>
      <table summary="" border="0" cellpadding="0">
      <tr><td width="1%" valign="top" colspan="2">#&nbsp;</td><td>
        The sign is the bit-7 of the result value.
      </td></tr>
      <tr><td width="1%" valign="top" colspan="2">#&nbsp;</td><td>
        If the last operation was not a signed operation, P.N will still reflect bit-7 of the result,
        but will NOT be considered as a sign.
      </td></tr>
      </table>
    </tr>

    <tr><td width="1%" valign="top"><font color="black">2)</font>&nbsp;</td><td>
    As a result store for a <A href="#BIT">BIT</A> instruction:<br>
    </td></tr>
    <tr><td width="1%" valign="top">&nbsp;</td><td>
      <table summary="" border="0" cellpadding="0">
      <tr><td width="1%" valign="top" colspan="2">#&nbsp;</td><td>
        The <A href="#BIT">BIT</A> instruction reads the contents of the specified memory address and
        copies bit-7 of that value to P.N
      </td></tr>
      </table>
    </tr>
  </table>

</td></tr>
</table>

<br>

<table summary="" border="0">
<tr><td colspan="2">
<A name="FLG-V">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
oVerflow Flag (P.V)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions can affect P.V:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#CLV">CLV</A>, <A href="#BIT">BIT</A>
<A href="#ADC">ADC</A>, <A href="#SBC">SBC</A>
<A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions depend on P.V:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#BVC">BVC</A>, <A href="#BVS">BVS</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
There is NO instruction to directly SET P.V
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.V can be CLEARed by the user by means of the <a href="#CLV">CLV</a> instruction
<tr><td width="1%" valign="top">#&nbsp;</td><td>

  <table summary="" border="0" cellpadding="0"><tr><td width="1%" valign="top" colspan="2">
    <b>P.V serves TWO purposes</b>
    </td></tr>

    <tr><td width="1%" valign="top"><font color="black">1)</font>&nbsp;</td><td>
    To signify an oVerflow (a sign change) during a mathmatical operation.
    Caused by an <A href="#ADC">ADC</A> or <A href="#SBC">SBC</A> instruction:
    </td></tr>
    <tr><td width="1%" valign="top">&nbsp;</td><td>
      <table summary="" border="0" cellpadding="0">
      <tr><td width="1%" valign="top" colspan="2">#&nbsp;</td><td>
        If an <A href="#ADC">ADC</A> or <A href="#SBC">SBC</A> instruction generates a result that would
        require more than 8 bits to hold (that is,
        any number outside the range -128 to 127) then P.V is SET; else P.V is CLEARed.
      </td></tr>
      <tr><td width="1%" valign="top" colspan="2">#&nbsp;</td><td>
        This flag may be ignored if the programmer is NOT using signed arithmetic.
      </td></tr>
      </table>
    </tr>

    <tr><td width="1%" valign="top"><font color="black">2)</font>&nbsp;</td><td>
    As a result store for a <A href="#BIT">BIT</A> instruction:<br>
    </td></tr>
    <tr><td width="1%" valign="top">&nbsp;</td><td>
      <table summary="" border="0" cellpadding="0">
      <tr><td width="1%" valign="top" colspan="2">#&nbsp;</td><td>
        The <A href="#BIT">BIT</A> instruction reads the contents of the specified memory address and
        copies bit-6 of that value to P.V
      </td></tr>
      </table>
    </tr>
  </table>
</td></tr></table>
<br>

<table summary="" border="0">
<tr><td colspan="2">
<A name="FLG-B">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
Break Flag (P.B)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
  P.B and the <a href="#BRK">BRK</a> instruction seem to me to be one very badly thought out bodge.<br>
  If you do not plan to use the <a href="#BRK">BRK</a> instruction I would just ignore it!
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
  P.B is never actually set in the Flags register!
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
  When a <a href="#BRK">BRK</a> instruction occurs the Flags are PUSHed onto the <A href="#STACK">Stack</A>
  along with a return address<font color="black">*</font><br>
  It is <big><b>only</b></big> this copy of the Flags (the one on the <A href="#STACK">Stack</A>) that has P.B set!
</td></tr>

<tr><td colspan="2">&nbsp;</td></tr>
<tr><td width="1%" valign="top"><font color="black">*</font>&nbsp;</td><td>

<table summary="">
<tr><td colspan="2">
This return address is actually "Address_of_BRK_instruction+2".
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
Bearing in mind that the <a href="#BRK">BRK</a> instruction is only ONE byte long...<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
This means that if you simply issue an <a href="#RTI">RTI</a>,
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The byte immediately following the <a href="#BRK">BRK</a> instruction will be ignored.<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
I have read reasons as to WHY this is the case, but frankly they all stink!   ...Just deal with it!
</td></tr>
</table>

</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
For further information, see <A href="#INT">Interrupts</A>.
</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
</table>


<table summary="" border="0">
<tr><td colspan="2">
<A name="FLG-D">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
Decimal Flag (P.D)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions can affect P.D:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#CLD">CLD</A>, <A href="#SED">SED</A>
<A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions depend on P.D:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#ADC">ADC</A>, <A href="#SBC">SBC</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.D is "unknown" at boot.  Therefore the boot code should initialise this flag
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.D can be SET by the user by means of the <a href="#SED">SED</a> instruction
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.D can be CLEARed by the user by means of the <a href="#CLD">CLD</a> instruction
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.D dictates whether Addition (<a href="#ADC">ADC</a>) and Subtraction (<a href="#SBC">SBC</a>)
operate in the classic <i>Binary</i> or the more obscure <a href="#BCD"><i>Binary Coded Decimal (BCD)</i></a>
mode.
</td></tr>
</table>

<br>

<a name="BCD">&nbsp;</A>
<table summary="" border="0">
<tr>
  <td width="5%">&nbsp;</td>
  <td>
    <hr width="40%" align="left">
    <font color="black"><b>
    Binary Coded Decimal (BCD)
    </b></font>
    <hr width="40%" align="left">
  </td>
</tr>
<tr>
  <td width="5%">&nbsp;</td>
  <td>
    BCD is whereby the upper and lower nibbles (4-bits) of a byte (8-bits) are treated as two digits in a decimal number;<br>
    The upper nibble contains the number from the 'tens column'; and the lower nibble, the number from the
    'units column'
  </td>
</tr>
<tr>
  <td width="5%">&nbsp;</td>
  <td>
    By Example:
    10010011 (or 1001'0011) represents 93 (or 9'3)<br>
    Thus restricting the range of values that can be held in a single byte to the positive integers
    0 through 99.
  </td>
</tr>
<tr>
  <td width="5%">&nbsp;</td>
  <td>
    The upshot is that any routine "PrintHex" will effectively become "PrintDecimal"
    ...Other than that I personally have never worked out why!  And as such I do not intend to cover
    it in any more detail here.
    My suggestion is perform a <a href="#CLD">CLD</a> during boot up and forget about it!
  </td>
</tr>
</table>

<br><br>

<table summary="" border="0">
<tr><td colspan="2">
<hr width="40%" align="left">
<A name="FLG-I">&nbsp;</A>
<font color="black"><b>
Interrupt (disable) Flag (P.I)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions can affect P.I:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#CLI">CLI</A>, <A href="#SEI">SEI</A>
<A href="#BRK">BRK</A>, <A href="#RTI">RTI</A>, <A href="#PLP">PLP</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions depend on P.I:<br>
<i>~None~</i>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.I can be CLEARed by the user by means of the <a href="#CLI">CLI</a> instruction
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.I can be SET by the user by means of the <a href="#SEI">SEI</a> instruction
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
When P.I is SET, <A href="#INT">Interrupt ReQuest signals (IRQs)</A> to the IRQ pin (classically pin-4) are IGNORED
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
When P.I is CLEAR, signals to the <A href="#INT">IRQ pin</A> are acknowledged.
</td></tr>
<tr><td width="1%" valign="top">&nbsp;</td><td>
Full details can be found under <A href="#INT">Interrupts and Interrupt ReQuests (IRQ's)</A>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
When the processor is switched on or reset, P.I is SET.<br>
Thus <A href="#INT">Interrupts</A> are <i>disabled</i> on startup.<br>
The intention here is to give the boot code an opportunity to initialise all external hardware without
Interruption from that hardware.
</td></tr>
</table>

<br>

<table summary="" border="0">
<tr><td colspan="2">
<A name="FLG-Z">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
Zero Flag (P.Z)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions affect P.Z:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#ADC">ADC</A>, <A href="#SBC">SBC</A>, <A href="#INC">INC</A>, <A href="#INX">INX</A>, <A href="#INY">INY</A>, <A href="#DEC">DEC</A>, <A href="#DEX">DEX</A>, <A href="#DEY">DEY</A>
<A href="#AND">AND</A>, <A href="#EOR">EOR</A>, <A href="#ORA">ORA</A>, <A href="#BIT">BIT</A>, <A href="#CMP">CMP</A>, <A href="#CPX">CPX</A>, <A href="#CPY">CPY</A>
<A href="#ASL">ASL</A>, <A href="#LSR">LSR</A>, <A href="#ROL">ROL</A>, <A href="#ROR">ROR</A>
<A href="#LDA">LDA</A>, <A href="#LDX">LDX</A>, <A href="#LDY">LDY</A>
<A href="#PLA">PLA</A>, <A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>
<A href="#TAX">TAX</A>, <A href="#TAY">TAY</A>, <A href="#TSX">TSX</A>, <A href="#TXA">TXA</A>, <A href="#TYA">TYA</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions depend on P.Z:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#BEQ">BEQ</A>, <A href="#BNE">BNE</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
There are no instructions to directly SET or CLEAR P.Z
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.Z is SET when a zero value is placed in a register
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.Z is CLEARed when a non-zero value is placed in a register
</td></tr>
</table>

<br>

<table summary="" border="0">
<tr><td colspan="2">
<A name="FLG-C">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
Carry Flag (P.C)
</b></font>
<hr width="40%" align="left">
<br>
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions affect P.C:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#CLC">CLC</A>, <A href="#SEC">SEC</A>
<A href="#ADC">ADC</A>, <A href="#SBC">SBC</A>
<A href="#CMP">CMP</A>, <A href="#CPX">CPX</A>, <A href="#CPY">CPY</A>
<A href="#ASL">ASL</A>, <A href="#LSR">LSR</A>, <A href="#ROL">ROL</A>, <A href="#ROR">ROR</A>
<A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
The following instructions depend on P.C:<br>
<tr><td width="1%" valign="top">&nbsp;</td><td><pre>
<A href="#BCC">BCC</A>, <A href="#BCS">BCS</A>
<A href="#ADC">ADC</A>, <A href="#SBC">SBC</A>
<A href="#ROL">ROL</A>, <A href="#ROR">ROR</A>
</pre></td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.C is "unknown" at boot.  Therefore the boot code should initialise this flag
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.C can be SET by the user by means of the <a href="#SEC">SEC</a> instruction
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.C can be CLEARed by the user by means of the <a href="#CLC">CLC</a> instruction
</td></tr>
<tr><td width="1%" valign="top">#&nbsp;</td><td>
P.C can be considered to be the 9th bit of an arithmetic operation.
</td></tr>
</table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="ADDR_MODE">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Addressing Modes
      </font></h1></td></tr></table>
    </center>
    <br><br>

<table summary="">
  <tr> <td><big><b>Name</b></big><td>  <pre>-</pre></td>
       <td><big><b>Abbreviation</b></big></td> </tr>
  <tr> <td><A href="#ADDR-ABS"   >Absolute</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-ABS"   >"Abs"</a></td> </tr>
  <tr> <td><A href="#ADDR-ABSI"  >Absolute Indexed</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-ABSI"  >"Abs,X" &amp; "Abs,Y"</a></td> </tr>
  <tr> <td><A href="#ADDR-ACC"   >Accumulator</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-ACC"   >"A"</a></td> </tr>
  <tr> <td><A href="#ADDR-IMM"   >Immediate</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-IMM"   >"Immed"</a></td> </tr>
  <tr> <td><A href="#ADDR-IMP"   >Implied</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-IMP"   >"Implied"</a></td> </tr>
  <tr> <td><A href="#ADDR-IIND"  >Indexed Indirect</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-IIND"  >"(Ind,X)"</a></td> </tr>
  <tr> <td><A href="#ADDR-IND"   >Indirect</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-IND"   >"Indirect"</a></td> </tr>
  <tr> <td><A href="#ADDR-INDI"  >Indirect Indexed</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-INDI"  >"(Ind),Y"</a></td> </tr>
  <tr> <td><A href="#ADDR-REL"   >Relative</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-REL"   >"Relative"</a></td> </tr>
  <tr> <td><A href="#ADDR-ZP"    >Zero-Page</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-ZP"    >"ZP"</a></td> </tr>
  <tr> <td><A href="#ADDR-ZPI"   >Zero-Page Indexed</A></td><td><pre>-</pre></td>
       <td><A href="#ADDR-ZPI"   >"ZP,X" &amp; "ZP,Y"</a></td> </tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-IMP">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"Implied" : Implied Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    This mode is whereby no address <i>or</i> value is specified by the programmer.  Some of
    these instructions perform no memory access at all:
  </td></tr>

  <tr><td width="1%">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   TXA                                    </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = X                                  </pre>
  </td></tr>
</table><br>
  </td></tr>

  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Others require memory addresses, but these are either known or calculated by the CPU at run time.
  </td></tr>

  <tr><td width="1%" valign="top">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   PHA                                    </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     bPoke(SP,A)
             SP = SP - 1                            </pre>
  </td></tr>
</table><br>
  </td></tr>

  <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%" valign="top">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   BRK                                    </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     bPoke(SP,A)
             SP = SP - 1
             bPoke(SP,P)
             SP = SP - 1
             PC = (bPeek($FFFF)<<8) | bPeek($FFFE)  </pre>
  </td></tr>
</table><br>
  </td></tr>

  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Implied Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#CLC">CLC</A>, <A href="#CLD">CLD</A>, <A href="#CLI">CLI</A>, <A href="#CLV">CLV</A>,
    <A href="#DEX">DEX</A>, <A href="#DEY">DEY</A>, <A href="#INX">INX</A>, <A href="#INY">INY</A>,
    <A href="#NOP">NOP</A>, <A href="#PHA">PHA</A>, <A href="#PHP">PHP</A>, <A href="#PLA">PLA</A>,
    <A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>, <A href="#RTS">RTS</A>, <A href="#SEC">SEC</A>,
    <A href="#CLD">CLD</A>, <A href="#SEI">SEI</A>, <A href="#TAX">TAX</A>, <A href="#TAY">TAY</A>,
    <A href="#TSX">TSX</A>, <A href="#TXA">TXA</A>, <A href="#TXS">TXS</A>, <A href="#TYA">TYA</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-ACC">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"A" : Accumulator Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    There are a number of "atomic read/modify/write" instructions which can address EITHER
    Memory OR the Accumulator (A)
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    In this case one cannot 'infer' A (as above), it MUST be stated.
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   DEC  A                                 </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = A - 1                              </pre>
  </td></tr>
</table><br>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Accumulator Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#ASL">ASL</A>, <A href="#LSR">LSR</A>, <A href="#ROL">ROL</A>, <A href="#ROR">ROR</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-IMM">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"Immed" : Immediate Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    A better name for this mode might be <b>Immediate <i>Value</i></b> as no "addressing" actually takes place.
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  #$A5                              </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = $A5                                </pre>
  </td></tr>
</table><br>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Immediate Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#CMP">CMP</A>, <A href="#CPX">CPX</A>,
    <A href="#XPY">XPY</A>, <A href="#EOR">EOR</A>, <A href="#LDA">LDA</A>, <A href="#LDX">LDX</A>,
    <A href="#LDY">LDY</A>, <A href="#ORA">ORA</A>, <A href="#SBC">SBC</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-REL">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"Relative" : Relative Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    This mode is used exclusively by the Branch instructions.  For further information see
    <A href="#BRA">Conditional Branches</A>
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Immediate Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#BCC">BCC</A>, <A href="#BCS">BCS</A>, <A href="#BEQ">BEQ</A>, <A href="#BMI">BMI</A>,
    <A href="#BNE">BNE</A>, <A href="#BPL">BPL</A>, <A href="#BVC">BVC</A>, <A href="#BCS">BCS</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-ABS">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"Abs" : Absolute Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Read a value from a 16-bit address
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Remember without special external hardware for paging, the 6502 only has a maximum of 64K of
    address space available - so 16-bits is enough to address ANY byte of memory.
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  $A5B6                             </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = bPeek($A5B6)                       </pre>
  </td></tr>
</table><br>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Absolute Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#ASL">ASL</A>, <A href="#BIT">BIT</A>,
    <A href="#CMP">CMP</A>, <A href="#CPX">CPX</A>, <A href="#CPY">CPY</A>, <A href="#DEC">DEC</A>,
    <A href="#EOR">EOR</A>, <A href="#INC">INC</A>, <A href="#JMP">JMP</A>, <A href="#JSR">JSR</A>,
    <A href="#LDA">LDA</A>, <A href="#LDX">LDX</A>, <A href="#LDY">LDY</A>, <A href="#LSR">LSR</A>,
    <A href="#ORA">ORA</A>, <A href="#ROL">ROL</A>, <A href="#ROR">ROR</A>, <A href="#SBC">SBC</A>,
    <A href="#STA">STA</A>, <A href="#STX">STX</A>, <A href="#STY">STY</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-ZP">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"ZP" : Zero-Page Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Much like Absolute Addressing, but can only address the first 256 (0..255) bytes of memory.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The benefit is a saving of 1 T-State :)
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  $A5                               </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = bPeek($A5)                         </pre>
  </td></tr>
</table><br>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Zero-Page Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#ASL">ASL</A>, <A href="#BIT">BIT</A>,
    <A href="#CMP">CMP</A>, <A href="#CPX">CPX</A>, <A href="#CPY">CPY</A>, <A href="#DEC">DEC</A>,
    <A href="#EOR">EOR</A>, <A href="#INC">INC</A>, <A href="#LDA">LDA</A>, <A href="#LDX">LDX</A>,
    <A href="#LDY">LDY</A>, <A href="#LSR">LSR</A>, <A href="#ORA">ORA</A>, <A href="#ROL">ROL</A>,
    <A href="#ROR">ROR</A>, <A href="#SBC">SBC</A>, <A href="#STA">STA</A>, <A href="#STX">STX</A>,
    <A href="#STY">STY</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-ABSI">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"Abs,X" &amp; "Abs,Y" : Absolute Indexed Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    In Absolute Addressing the destination address is fixed by the programmer (or assembler) at
    assembly time.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    By using the hard-coded address as a <i>base</i>, and X or Y as an <i>Index</i>, a more dynamic addressing
    system can be implemented.<br>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    If the result of Base+Index is greater than $FFFF, wrapping will occur.<br>
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  $A5B6,X                           </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = bPeek( ($A5B6+X) &amp; $FFFF )         </pre>
  </td></tr>
</table><br>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  $A5B6,Y                           </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = bPeek( ($A5B6+Y) &amp; $FFFF )         </pre>
  </td></tr>
</table><br>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Absolute Indexed Addressing with <b>X</b> is available for the following instructions:<br>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#ASL">ASL</A>, <A href="#CMP">CMP</A>,
    <A href="#DEC">DEC</A>, <A href="#EOR">EOR</A>, <A href="#INC">INC</A>, <A href="#LDA">LDA</A>,
    <A href="#LDY">LDY</A>, <A href="#LSR">LSR</A>, <A href="#ORA">ORA</A>, <A href="#ROL">ROL</A>,
    <A href="#ROR">ROR</A>, <A href="#SBC">SBC</A>, <A href="#STA">STA</A>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Absolute Indexed Addressing with <b>Y</b> is available for the following instructions:<br>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#CMP">CMP</A>, <A href="#EOR">EOR</A>,
    <A href="#LDA">LDA</A>, <A href="#LDX">LDX</A>, <A href="#ORA">ORA</A>, <A href="#SBC">SBC</A>,
    <A href="#STA">STA</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-ZPI">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"ZP,X" &amp; "ZP,Y" : Zero-Page Indexed Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    In Zero-Page Addressing the destination address is fixed by the programmer (or assembler)
    at assembly time.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    By using the hard-coded address as a <i>base</i>, and X or Y as an <i>Index</i>, a more dynamic
    addressing system can be implemented.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    With Zero-Page, only the first 256 (0..255) bytes of memory may be addressed. So if the result of
    Base+Index is greater than $FF, wrapping will occur.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The benefit is a saving of 1 T-State :)<br>
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  $A5,X                             </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     A = bPeek( ($A5+X) &amp; $FF )             </pre>
  </td></tr>
</table><br>
<br><table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDX  $A5,Y                             </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     X = bPeek( ($A5+Y) &amp; $FF )             </pre>
  </td></tr>
</table>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
     Zero-Page Indexed Addressing with <b>X</b> is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
     <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#ASL">ASL</A>, <A href="#CMP">CMP</A>,
     <A href="#DEC">DEC</A>, <A href="#EOR">EOR</A>, <A href="#INC">INC</A>, <A href="#LDA">LDA</A>,
     <A href="#LDY">LDY</A>, <A href="#LSR">LSR</A>, <A href="#ORA">ORA</A>, <A href="#ROL">ROL</A>,
     <A href="#ROR">ROR</A>, <A href="#SBC">SBC</A>, <A href="#STA">STA</A>, <A href="#STY">STY</A>
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Zero-Page Indexed Addressing with <b>Y</b> is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#LDX">LDX</A>, <A href="#STX">STX</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-IND">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"Indirect" : Indirect Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
With this instruction, the 8-but address (location) supplied by the programmer is considered to be a
Zero-Page address, that is, an address in the first 256 (0..255) bytes of memory.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
The content of this Zero-Page address must contain the low 8-bits of a memory address
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
The following byte (the contents of address+1) must contain the upper 8-bits of a memory address
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
Once this memory address has been read from the Zero-Page location (specified by the programmer), this
calculated memory address is then examined, and it's contents are returned.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
Although tricky to explain, the concept is actually quite simple.  The upshot is that you do not
need to hard-code all address value, this system allows addresses to be calculated at run time.
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  $A5                               </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     l = bPeek( $A5 )
             h = bPeek( ($A5+1) &amp; $FF )<<8
             m = h | l
             A = bPeek(m)                           </pre>
  </td></tr>
</table>
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Indirect Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#JMP">JMP</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-IIND">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"(Ind,X)" : Indexed Indirect Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    This addressing mode is only available with X.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Much like Indirect Addressing, but the contents of the index register is added to the Zero-Page
    address (location)
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    If Base_Location+Index is greater than $FF, wrapping will occur.
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  ($A5,X)                           </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     l = bPeek( ($A5+X) &amp; $FF )
             h = bPeek( ($A5+X+1) &amp; $FF ) <<8
             m = h | l
             A = bPeek(m)                           </pre>
  </td></tr>
</table>
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Indexed Indirect Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#CMP">CMP</A>, <A href="#EOR">EOR</A>,
    <A href="#LDA">LDA</A>, <A href="#ORA">ORA</A>, <A href="#SBC">SBC</A>, <A href="#STA">STA</A>
  </td></tr>
</table>
<br><br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<A name="ADDR-INDI">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
"(Ind),Y" : Indirect Indexed Addressing
</b></font>
<hr width="40%" align="left">
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    This addressing mode is only available with Y.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Much like Indexed Addressing, but the contents of the index register is added to the Base_Location
    after it is read from Zero-Page memory.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    If Base_Location+Index is greater than $FFFF, wrapping will occur.
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   LDA  ($A5),Y                          </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     l = bPeek( $A5 )
             h = bPeek( ($A5+1) &amp; $FF )<<8
             m = ( (h|l)+Y ) &amp; $FFFF
             A = bPeek(m)                           </pre>
  </td></tr>
</table>
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Indirect Indexed Addressing is available for the following instructions:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#ADC">ADC</A>, <A href="#AND">AND</A>, <A href="#CMP">CMP</A>, <A href="#EOR">EOR</A>,
    <A href="#LDA">LDA</A>, <A href="#ORA">ORA</A>, <A href="#SBC">SBC</A>, <A href="#STA">STA</A>
  </td></tr>
</table>
<br>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="MEM_MAP">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      6502 Memory Map
      </font></h1></td></tr></table>
    </center>
    <br><br>

The 6502 memory map is not strict, architecture may use different compositions.<br>
The following is the structure proposed by Rockwell and implemented by many, if not most, implementations
of the architecture.<br>
<br>


<table summary="" border="0" bgcolor="#ffffff" cellpadding="10" align="center">
<tr><td valign="top"><pre><big>
 0000-00FF  - RAM for <a href="#ADDR-ZP">Zero-Page</A> &amp; <a href="#ADDR-IND">Indirect-Memory Addressing</A>
 0100-01FF  - RAM for <a href="#STACK">Stack</A> Space &amp; <a href="#ADDR-ABS">Absolute Addressing</A>
 0200-3FFF  - RAM for programmer use
 4000-7FFF  - Memory mapped I/O
 8000-FFF9  - ROM for programmer useage
 FFFA       - Vector address for NMI (low byte)
 FFFB       - Vector address for NMI (high byte)
 FFFC       - Vector address for RESET (low byte)
 FFFD       - Vector address for RESET (high byte)
 FFFE       - Vector address for <A href="#INT">IRQ</A> &amp; <a href="#BRK">BRK</A> (low byte)
 FFFF       - Vector address for <A href="#INT">IRQ</A> &amp; <a href="#BRK">BRK</A>  (high byte)     </big></pre>
</td>
</tr>
</table>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="STACK">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      The Stack
      </font></h1></td></tr></table>
    </center>
    <br><br>

Assembler newcomers might like to read <a href="#STACK_WHAT">What is The Stack?</a>
<br><br>
Given that you know what a Stack is ...this is probably the information you are after:
<br><br>

<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
  The Stack Pointer is standardly abbreviated to "SP" or "S" depending on many factors, not least of
  all the author of the document you are reading.
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  For the duration of this section of the document, the <a href="#FLAGS">Processor Status Word (or "Flags")</a> will be
  referred to as <b>PSW</b>
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  The following instructions affect the Stack:
  <A href="#BRK">BRK</A>, <A href="#JSR">JSR</A>, <A href="#PHA">PHA</A>, <A href="#PHP">PHP</A>,
  <A href="#PLA">PLA</A>, <A href="#PLP">PLP</A>, <A href="#RTI">RTI</A>, <A href="#RTS">RTS</A>,
  <A href="#TXS">TXS</A>
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#TXS">TXS</A> is used by the programmer to initialise the Stack Pointer.
  An example of this can be found in the <A href="#BOOT">System Startup code</A>.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  The Stack can only live in Page 1 of memory;
    That is, addresses in the range $01'00...$01'FF
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  Therefore SP is only an 8-bit value
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  This means that the Stack will wrap around within Page 1 if care is not taken.
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#PHA">PHA</A> PusHes a single byte onto the Stack;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  This byte will contain a copy of the value currently in register A
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#PHP">PHP</A> PusHes a single byte onto the Stack;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  This byte will contain a copy of the value currently in the <a href="#FLAGS">PSW</a>
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#PLA">PLA</A> PulLs (or "POPs") a single byte from the stack;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  This value retrieved will be stored in A
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#PLP">PLP</A> PulLs (or "POPs") a single byte from the stack;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  This value retrieved will be stored in the <a href="#FLAGS">PSW</a>
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  The easiest way to set the Flags to a "known value" is:
  </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="" bgcolor="#ffffff"><tr><td><pre>
  LDA   $A5      ; A = "known value" ...$A5, in this case
  PHA            ; Place a copy of the value in A onto the Stack
  PLP            ; Retrieve the top value on the Stack into the <a href="#FLAGS">PSW</a>  </pre>
</td></tr></table>
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#JSR">JSR</A> and <A href="#RTS">RTS</A> are the 6502 equivalents of
  <a href="#GOSUB">GOSUB and RETURN</a>;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  A comprehensive explanation of their use of the Stack is under <a href="#GOSUB">GOSUB and RETURN</a>
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#BRK">BRK</A> simulates an interrupt, but behaves most perculiarly.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#BRK">BRK</A> places THREE bytes on the stack.<br>
  </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
  <table summary="">
    <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The first byte on is the MSB of the (Return_Address_plus_one)<br>
    </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    The second byte on is the LSB of the (Return_Address_plus_one)<br>
    </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    The third byte on is a copy of the current <a href="#FLAGS">PSW</a>, with <a href="#FLG-B">P.B</a> SET<br>
    It should be noted that <a href="#FLG-B">P.B</a> is not SET in the <a href="#FLAGS">PSW</a>
    </tr>
  </table>
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  The effects and uses of <A href="#BRK">BRK</A> are also discussed at the following locations:
  <table summary="">
    <tr><td width="1%" valign="top">&nbsp;</td><td>
    <A href="#BRK">BRK - Simulate an Interrupt ReQuest (IRQ)</A>
    </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
    <a href="#FLG-B">Break Flag (P.B)</a>
    </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
    <a href="#INT">Interrupts</a> - How can I simulate an Interrupt?
    </td></tr>
  </table>
  <!-- blank --></td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>&nbsp;
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
  <A href="#RTI">RTI</A> is used to terminate an Interrupt or to return from a <A href="#BRK">BRK</A> instruction.
  <A href="#RTI">RTI</A> removes THREE bytes from the Stack<br>
  <table summary="">
    <tr><td width="1%" valign="top">&nbsp;</td><td>
    The first byte on the Stack is retrieved and place in P
    </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
    The next byte on the Stack is retrieved and place in the LSB of the <A href="#FLOW">Program Counter (PC)</A>
    </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
    The next byte on the Stack is retrieved and place in the MSB of the <A href="#FLOW">Program Counter (PC)</A>
    </td></tr>
  </table>
  </td></tr>
</table>
<br><br>

<a name="STACK_WHAT">&nbsp;</A>
<table summary="" align="center" frame="box"><tr><td><font color="black"><big><big><b>&nbsp;&nbsp;&nbsp;
The Stack - What Is It?
&nbsp;&nbsp;&nbsp;</b></big></big></font></td></tr></table>
<br><br>
I once sat through a one hour lecture where a professor of computer science completely failed to
explain The Stack.  WHAT IS THE PROBLEM?<br>
<br>
The Stack is a very very simple idea.  It's a "pile of stuff" and due to the laws of physics
you can only add or remove stuff to or from the top.<br>
Okay, it does NOT build from the ground-up, but from the ceiling-down - if that is too confusing,
stand on your hands while you read that again :)<br>
<br>
If you want something in the middle ...you take all the stuff off the top; remove the thing you
want; and put all the other stuff back.<br>
In reality, you could build some scaffolding and carefully remove something from the middle.  And
yes, you can metaphorically do the same thing in assembler ...WHEN you know how it's done.<br>
<br>
So, before you try to get clever ...read this:<br>
<br>
<table summary="" border="0">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Imagine a cardboard box that can hold 8-bits of information.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    Now Imagine a STACK of these boxes.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    Next to this STACK, is a guard to stands watch over it.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    His main guard duty is to POINT to the space where the next box will go.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    Due to the nature of physics, this gap will always be just above the the top-most box!
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    If anyone PUSHes another box onto the STACK, it will be added to the STACK at precisely where the
    guard is POINTing.  After this has happened the guard will automatically move his finger and POINT
    at the new space.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    If anyone PULLs (or POPs) a box from the stack; that is, should anyone as the guard for the top box.
    He will move his finger to point at the last box, and then pass it to you.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    The result is that as he passes you the box, his finger is left POINTing at the newly formed space.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    This creates a "last-in, first-out" system - because you can only ever access the TOP of the stack.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    ...oh yeah, one more thing...<br>
    This system was designed by an Australian;  As we all know, the laws of
    physics invert when you are on the bottom of the globe.<br>
    So the stack actually builds from the ceiling down - deal with it!
  </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    Realise that there is a limited amount of room an the STACK.<br>
    If the STACK is full and you attempt to PUSH another box STACK a "Stack Overflow" condition will occur.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    On many modern system architecture you will receive a warning when this occurs.<br>
    This is NOT true of the 6502 STACK POINTer<br>
    So it is the concern of the programmer to be careful that this does not occur.
  </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    There are a couple of more subtle things that are for the advanced programmer.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    When a box is removed, a ghost of it remains.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    This ghost is a perfect copy of the last box which occupied that space.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    But be warned, a light breeze that passes that area of the warehouse will destroy the ghost,
    so do NOT depend on the presence of this ghost too heavily.
  </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    In actual fact you do not retrieve the value on the TOP of the stack, but actually the value
    which is indicated by the STACK POINTER
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    For a bribe, (the currency is T-states in this world), the guard will point anywhere you want him to,
    including (but not restricted to) the middle of the stack.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    Bear in mind that during this process, the stack will NOT be guarded.
    BE WARNED it may not be there when you get back!
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    This is a very dodgy process and considered to be very bad coding etiquette, but a is also a damn fine way
    to confuse hackers and has found many other weird and wonderful uses in it's life.
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    ...what this security guard will do for a small bribe is certainly perverted, but great fun to watch :)
  </td></tr><tr><td width="1%" valign="top">&nbsp;</td><td>
  </td></tr><tr><td width="1%" valign="top">#&nbsp;</td><td>
    Question:  What colour uniform was the guard wearing?
  </td></tr>
</table>
<br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="FLOW">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Program Flow Control
      </font></h1></td></tr></table>
    </center>
    <br><br>

The Program Counter (PC) is a 16-bit register and is therefore capable of addressing ANY byte in the 64K
or 65536 bytes (0..65535) memory space.<br>
It always holds the address of the next instruction to be exeucted.<br>
<br>
Program flow control is effected by changing the value in PC.<br>
<br>

First, a brief note should made here about the way instructions execute.<br>
<table summary="">
  <tr><td width="1%">#&nbsp;</td><td>
    The "Fetch-Execute cycle" is what drives a processor
  </td></tr><tr><td width="1%">#&nbsp;</td><td>
    The processor fetches an instruction and then executes it.
  </td></tr><tr><td width="1%">#&nbsp;</td><td>
    The Program Counter is incremented AFTER the Fetch phase and BEFORE the Execute phase.
  </td></tr><tr><td width="1%">#&nbsp;</td><td>
    Therefore... during Execution of an instruction, the Program Counter is pointing at the NEXT
    instruction to be executed; NOT this one!
  </td></tr><tr><td width="1%">#&nbsp;</td><td>
    This is particularly important when considering the destination of a <A href="#BRA">Branch instructions</A>.
  </td></tr><tr><td width="1%">#&nbsp;</td><td>
    And makes perfect sense when considered in relation to the <A href="#JSR">JSR</A>
    and <A href="#RTS">RTS</A> instructions.
  </td></tr>
</table>
<br>

<A href="#INT">Interrupts</A> also modify the flow of execution.<br>
But as they are not normally under programmer control, they are covered in detail in their own section:
<A href="#INT">Interrupts and Interrupt ReQuests (IRQ's)</A><br>
<br><br>

<A name="BRA">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
Conditional Branching
</b></font>
<hr width="40%" align="left">
<br>

<table summary="">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The following Conditional Branch instructions are available:<br>
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <table summary="">
      <tr><td width="1%">#&nbsp;</td><td>
        <A href="#BCC">BCC - Branch iff Carry flag (P.C) is CLEAR</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BCS">BCS - Branch iff Carry flag (P.C) is SET</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BEQ">BEQ - Branch iff Carry flag (P.Z) is SET</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BMI">BMI - Branch iff sigN flag (P.N) is SET</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BNE">BNE - Branch iff Carry flag (P.Z) is CLEAR</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BPL">BPL - Branch iff sigN flag (P.N) is CLEAR</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BVC">BVC - Branch iff oVerflow flag (P.V) is CLEAR</A><br>
      </td></tr><tr><td width="1%">#&nbsp;</td><td>
        <A href="#BVS">BVS - Branch iff oVerflow flag (P.V) is SET</A><br>
      </td></tr>
    </table>
  </td></tr>
  <tr><td width="1%" valign="top" colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    It should be noted that there is NO <b>un</b>conditional branch!  ...but one can be simlated by setting a
    <A href="#FLAGS">Processor Status Word</A> Flag to a known state and then Branching on <i>that</i> condition flag.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The operand to a Branch instruction is a single byte offset (8 bits, giving a range of -128 to 127)
    which specifies the new <A href="#FLOW">Program Counter (PC)</A> address realtive to it's current position.  Hence the
    name <A href="#ADDR_REL">Relative Addressing</A>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    All branch commands are two bytes long - one byte for the Branch instruction; another for the
    relative offset.
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <table summary="" frame="box">
      <tr><td width="3%">&nbsp;</td><td>So  </td><td><pre>  BR  +0  </pre></td>
          <td>will have no effect on program flow.</td></tr>
      <tr><td width="3%">&nbsp;</td><td>and </td><td><pre>  BR  -2  </pre></td>
          <td>will cause an infinite loop ...a nice place to sit and wait for an
              <A href="#INT">Interrupts</A>?</td></tr>
    </table>
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The advantage of <A href="#ADDR_REL">Relative Addressing</A> is that it geneates fully relocatable
    code; That is, the program will execute normally no matter where it is loaded into memory.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The down-side <A href="#ADDR_REL">Relative Addressing</A> is that compromises must be made if
    you wish to change PC by more than {-128 to +127}.
  </td></tr>
</table>
<br>

<table summary="" border="0">
  <tr>
    <td colspan="3"><u>Two solutions are available to long branches:</u></td>
  </tr>
  <tr>
    <td><font color="black">1)</font></td>
    <td colspan="2">Use a "complimented branch and jump pair"</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>Consider this example where "label" is <i>'out of range'</i></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">&nbsp;</td>
    <td>
      <table summary="" bgcolor="#ffffff"><tr><td><pre><font color="black">
         ...
         BCC      label    ; Branch to "label" is P.C is Clear
         [blah]
         ...
         ...
 label:  [foobar]                                                                      </font></pre>
      </td></tr></table>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>This code can be replaced with</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">&nbsp;</td>
    <td>
      <table summary="" bgcolor="#ffffff"><tr><td><pre>
         ...
         BCS    $$       ; Branch to "$$" is P.C is Set
         JMP    label    ; Jump to "label"
 $$:     [blah]
         ...
         ...
 label:  [foobar]                                                                      </pre>
      </td></tr></table>
    </td>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>The advantage of this method is that the memory overhead is only 3 bytes</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>
      And although it may cause several passes for an assembler, the process can be automated simply
      and still produce readable code.
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>
      The disadvantage is that the code will no longer be relocatable.
    </td>
  </tr>
  <tr><td colspan="3">&nbsp;</td></tr>

  <tr>
    <td><font color="black">2)</font></td>
    <td colspan="2">"skip" or "leap-frog" through the code.</td>
  </tr><tr>
    <td>&nbsp;</td><td colspan="2">
    <table summary="" border="0">
      <tr>
        <td valign="top">#&nbsp;</td>
        <td>
          This process involves placing branches at intermediate points throughout the code.
        </td>
      </tr><tr>
        <td valign="top">#&nbsp;</td>
        <td>
          This process will ensure that the resultant program is still relocatable,  but at the cost
          of bulky and long winded code which can become unreadable quite quickly.
        </td>
      </tr><tr>
        <td valign="top">#&nbsp;</td>
        <td>
          One should also consider the fact that there is no BRA (BRanch Always) instruction in 6502.<br>
          Although, there is no reason that a smart assembler could not handle the process for you.
        </td>
      </tr><tr>
        <td valign="top">#&nbsp;</td>
        <td>
          To solve the same problem as set in resolution 1 above:
        </td>
      </tr><tr>
        <td valign="top">&nbsp;</td>
        <td>
      <table summary="" border="0" bgcolor="#ffffff"><tr><td><pre>
         ...
         BCC    $1       ; Branch to "$1" is P.C is Clear
         [blah]
         ...
         ...
         ...
         PHP             ; Preseve PSW/Flag status
         CLV             ; Clear P.?, where "?" is an flag other than that being used
         BVC    $$       ; Branch to "$$" is P.? is Clear
 $1:     BCC    label    ; Branch to "label" is P.C is Clear
 $$:     PLP             ; Restore PSW/Flag status
         ...
         ...
         ...
 label:  [foobar]                                                                      </pre>
      </td></tr></table>
        </td>
      </tr><tr>
        <td valign="top">#&nbsp;</td>
        <td>
          This "skipping" or "leap-frogging" process can be repeated as many time as is necessary to
          traverse the distance involved.
        </td>
      </tr><tr>
        <td valign="top">#&nbsp;</td>
        <td>
          The process outlined here is appropriate for a semi-intelligent assembler.  It could be
          optimised by careful choice of flag and placing of skip points.
        </td>
      </tr><tr>
        <td valign="top">#&nbsp;</td>
        <td>
          All-in-all it is a horrible clumsy method that should not be used unless the need is dire -
          It is memory hungry, ugly, uses <A href="#STACK">Stack</A> space, and results in unreadble code.
        </td>
      </tr>
    </table>
  </td></tr>
</table>
<br>

<table summary="" border="0"><tr>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>
      The following table shows how to assemble standard C comparisons to their 6502 equivalents.
    </td>
 </tr><tr>
    <td width="1%" valign="top">#&nbsp;</td>
    <td>
      It should be noted that two of the conditions require TWO Branch instructions to resolve,
      whereas the other four only require ONE.
    </td>
  <tr><td colspan="2">&nbsp;</td>
 </tr><tr>
    <td width="1%" valign="top">&nbsp;</td>
    <td>

<table summary="" border="0">
  <tr><td>
    <table summary="" bgcolor="#ffffff" border="1">
      <tr>
        <td valign="top">&nbsp;</td>
        <th align="center">Signed</th align="center">
        <th align="center">Unsigned</th align="center">
      </tr><tr>
        <td valign="top"><pre><font color="black"> IF (r <  M)  GOTO lbl  </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BMI  lbl  </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BCC  lbl  </font></pre></td>
      </tr><tr>
        <td valign="top"><pre><font color="black"> IF (r <= M)  GOTO lbl  </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BMI  lbl<br>  BEQ  lbl </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BCC  lbl<br>  BEQ  lbl </font></pre></td>
      </tr><tr>
        <td valign="top"><pre><font color="black"> IF (r == M)  GOTO lbl  </font></pre></td>
        <td colspan="2"><pre><font color="black">         CMP  M<br>         BEQ  lbl  </font></pre></td>
      </tr><tr>
        <td valign="top"><pre><font color="black"> IF (r != M)  GOTO lbl  </font></pre></td>
        <td colspan="2"><pre><font color="black">         CMP  M<br>         BNE  lbl  </font></pre></td>
      </tr><tr>
        <td valign="top"><pre><font color="black"> IF (r >= M)  GOTO lbl  </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BPL  lbl  </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BCS  lbl  </font></pre></td>
      </tr><tr>
        <td valign="top"><pre><font color="black"> IF (r >  M)  GOTO lbl  </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BEQ  +2<br>  BPL  lbl </font></pre></td>
        <td><pre><font color="black">  CMP  M<br>  BEQ  +2<br>  BCS  lbl </font></pre></td>
      </tr>
    </table>
  </td><td width="5%">&nbsp;</td>
  <td valign="top">
    <table summary="" bgcolor="#ffffff" border="1">
    <tr><td valign="top">
    <pre><font color="black"> IF (   bPeek(Mem)&amp;(1<<7)  ) GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  BIT  Mem <br>  BMI  lbl  </font></pre>
    </td></tr>
    <tr><td valign="top">
    <pre><font color="black"> IF ( !(bPeek(Mem)&amp;(1<<7)) ) GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  BIT  Mem <br>  BPL  lbl  </font></pre>
    </td></tr>
    <tr><td valign="top">
    <pre><font color="black"> IF (   bPeek(Mem)&amp;(1<<6)  ) GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  BIT  Mem <br>  BVS  lbl  </font></pre>
    </td></tr>
    <tr><td valign="top">
    <pre><font color="black"> IF ( !(bPeek(Mem)&amp;(1<<6)) ) GOTO lbl  </font></pre></td>
    <td><pre><font color="black">  BIT  Mem <br>  BVC  lbl  </font></pre>
    </td></tr>
    </table>
  </td></tr>
</table>
  <tr>
    <td width="1%" valign="top">&nbsp;</td>
    <td>
      <table summary=""><tr>
          <td width="1%" valign="top">#&nbsp;</td>
          <td>"r" is any one of the three primary registers {A, X, Y}</td>
        </tr><tr>
          <td width="1%" valign="top">#&nbsp;</td>
          <td>If A the intended register, then the CMP instruction must be used (as shown above).</td>
        </tr><tr>
          <td width="1%" valign="top">#&nbsp;</td>
          <td>
            If X or Y is intended register, then the CPX or CPY instruction must be used
            (in place of the CMP instructions shown in the table above).<br>
          </td>
      </tr></table>
    </td>
  </tr>
</table>
<br><br>


<A name="GOTO">&nbsp;</A>
<hr width="40%" align="left">
<font color="black"><b>
GOTO, GOSUB and RETURN
</b></font>
<hr width="40%" align="left">
<br>

<table summary="">
  <tr><td colspan="2"><hr width="30%" align="left"></td><td>
  <tr><td colspan="2"><b><A href="#JMP">JMP</A> - a.k.a GOTO</b></td><td>
  <tr><td colspan="2"><hr width="30%" align="left"></td><td>
  <tr><td colspan="2">&nbsp;</td><td>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The simplest way to change the execution flow of the processor is with the <A href="#JMP">JMP</A>
    instruction.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    This will immediately and unconditionally modify the Program Counter.  And effectively behaves
    just like the classic GOTO command in most higher level languages.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    <A href="#JMP">JMP</A> has TWO addressing modes, <A href="#ADDR-ABS">Absolute</A> and <A href="#ADDR-IND">Indirect</A>.
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <table summary="">
      <tr><td width="1%" colspan="2">
        <A href="#ADDR-ABS">Absolute Addressing</A>:
      </td></tr><tr><td width="1%">&nbsp;</td><td>
        <table summary="">
        <tr><td width="1%" valign="top">#&nbsp;</td><td>
        This is whereby the two bytes that follow the <A href="#JMP">JMP</A> instruction are
        the value which will be placed in PC.
        </td></tr>
        <tr><td width="1%" valign="top">#&nbsp;</td><td>
        And therefore, also the address of the next instruction that will be executed.
        </td></tr>
        </table>
      <tr><td width="1%">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   JMP  $A5B6                           </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     PC = $A5B6                           </pre>
  </td></tr>
</table>
      </td></tr><tr><td width="1%" valign="top" colspan="2">&nbsp;</td>
      </tr><tr><td width="1%" colspan="2">
        <A href="#ADDR-IND">Indirect Addressing</A>:
      </td></tr><tr><td width="1%">&nbsp;</td><td>
        <table summary="">
        <tr><td width="1%" valign="top">#&nbsp;</td><td>
        This mode allows the Destination address to be held anywhere in memory.
        </td></tr>
        <tr><td width="1%" valign="top">#&nbsp;</td><td>
        The two bytes that follow the <A href="#JMP">JMP</A> instruction are a pointer to where
        the Destination address is stored.
        </td></tr>
        <tr><td width="1%" valign="top">#&nbsp;</td><td>
        The 6502 is "little-endian", this means that:<br>
        The byte <i>immeditely</i> after the <A href="#JMP">JMP</A> instruction is the "Bottom" or "Low" 8-bits of the address<br>
        And the second byte that follows the <A href="#JMP">JMP</A> instruction is the "Top" or "Hight" 8-bits of the address
        </td></tr>
        </table>
      <tr><td width="1%">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   JMP  ($A5B6)                         </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     l = bPeek($A5B6)
             h = bPeek( ($A5B6+1) &amp; $FFFF ) <<8
             PC = h | l                           </pre>
  </td></tr>
</table>
      </td></tr>
    </table>
  </td></tr>
  <tr><td width="1%" valign="top" colspan="2">&nbsp;</td></tr>


  <tr><td colspan="2"><hr width="30%" align="left"></td><td>
  <tr><td colspan="2">
    <a name="GOSUB">&nbsp;</a><b><A href="#JSR">JSR</A> &amp; <A href="#RTS">RTS</A> - GOSUB &amp; RETURN</b>
  </td><td>
  <tr><td colspan="2"><hr width="30%" align="left"></td><td>
  <tr><td colspan="2">&nbsp;</td><td>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    <A href="#JSR">JSR</A> is normally used to call SubRoutines;<br>
    That is, small pieces of code which are used repetetively by the main code.<br>
    A typical example might be "print".
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    <A href="#JSR">JSR</A> behaves exactly like <A href="#JMP">JMP</A> in
      <A href="#ADDR-ABS">Absolute Addressing</A> Mode with one excpetion...
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Before PC is changed, a copy of PC is placed on the <A href="#STACK">Stack</A> for safe keeping.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    When the Subroutine is finished, it simply issues an <A href="#RTS">RTS</A> and the
    return address is retrieved from the <A href="#STACK">Stack</A> and placed back into PC.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The net result is that execution will then continue from exactly where it left off.
  </td></tr>
      <tr><td colspan="2">
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   JSR  $A5B5                           </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     t = PC - 1
             bPoke(SP,t.h)
             SP = SP - 1
             bPoke(SP,t.l)
             SP = SP - 1
             PC = $A5B6                           </pre>
  </td></tr>
</table>
      </td></tr>
      <tr><td colspan="2">&nbsp;</td></tr>
      <tr><td colspan="2">
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   RTS                                  </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Logic:     SP = SP + 1
             l = bPeek(SP)
             SP = SP + 1
             h = bPeek(SP)<<8
             PC = (h|l) +1                        </pre>
  </td></tr>
</table>
      </td></tr>
      <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    As can be seen from the Logic above, <A href="#JSR">JSR</A> actually stores PC-1 on the <A href="#STACK">Stack</A>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
<table summary="">
  <tr><td colspan="2">
    This means that the address on the <A href="#STACK">Stack</A> is actually:
  </td></tr>
  <tr><td width="1%" valign="top">A)&nbsp;</td><td>
    The byte BEFORE the instruction that follows the <A href="#JSR">JSR</A>
  </td></tr>
  <tr><td colspan="2">
    and
  </td></tr>
  <tr><td width="1%" valign="top">B)&nbsp;</td><td>
    The second byte of the <A href="#JSR">JSR</A> address; in this case $A5<br>
    (remember... "little-endian" -- the "lowest" or "least significant" byte comes first)
  </td></tr>
</table>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    RTS is sensible enough to know this, and corrects the error before making the return.
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Although it is not normally necessary to know this.<br>
    There are occasions when you may wish to Push an address on the <A href="#STACK">Stack</A> and then use
    the <A href="#RTS">RTS</A> instruction to initiate the jump.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    This is very unusual, but if you wish to use this method of Flow Control you must remember
    to<br>
    <font color="black"><b>Push the address of the destination instruction MINUS ONE</b></font>.
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
<table summary="">
  <tr><td width="5%">&nbsp;</td><td bgcolor="#000080"><pre>
  Example:   Affect a jump to memory address <font color="black"><b>$A5D8</b></font>    </pre>
  </td></tr><tr><td width="5%">&nbsp;</td><td bgcolor="#ffffff"><pre>
  Code:      LDA   #$A5
             PHA
             LDA   #$<b>D7</b>
             PHA
             RTS                </pre>
  </td></tr>
</table>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    If you plan to use this method, you should take time to read the section on <A href="#STACK">The Stack</A>.
  </td></tr>
</table>
<br>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="INT">&nbsp;</a>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      Interrupts and Interrupt ReQuests (IRQ's)
      </font></h1></td></tr></table>
    </center>
    <br><br>

<table summary="">
<tr><td colspan="4"><font color="black"><big><b>
What is an Interrupt?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  An Interrupt is, at it's most primitive level, a signal that comes into the CPU from
  one of it's pins.<br>
  Specifically, the one labelled "/IRQ".
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  When this pin is "pulled low" (Eg. has 0V applied to it), a signal is sent to the CPU core.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The CPU halts the current program and instead runs a special routine called
  the <b><A href="#ISR">Interrupt Service Routine</A></b>.
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
How can I ENable Interrupts?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  When the 6502 starts.  Interrupts are <b>dis</b>abled.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The intention here is to give the <A href="#BOOT">boot code</a> an opportunity to initialise
  all external hardware without interruption (from that hardware.)
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Interrupts can be enabled by CLEARing the <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A>
  with the <A href="#CLI">CLI</A> instruction.
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
How can I DISable Interrupts?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Sometimes, when you are executing time critical code, you may wish to ensure that you are
  not interrupted.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The process of disabling Interrupts is known as "Masking" or "Disabling" or "Inhibiting" or
  "Ignoring".
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  That is, you don't stop the interrupt from occuring, you just ignore it! ...you "Mask" it.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  To make the 6502 Mask interrupts you need to SET the <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  This is done with the <A href="#STI">STI</A> instruction.
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
What happens when an Interrupt occurs?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  First you must consider if Interrupts are disabled
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  If they are (disabled).  We do nothing!
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  If Interrupts are enabled (I.e. <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A> is CLEAR)
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The following process occurs:
  </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    The current instruction is allowed to finish.
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    The current PC is Pushed onto the <A href="#STACK">Stack</A>.
    </td></tr>
      <tr><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td>
      (This is the address of the next instruction).
      </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    A copy of the <A href="#FLAGS">Processor Status Word (Flags) (P.?)</A> is Pushed onto the <A href="#STACK">Stack</A>.
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    The <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A> is SET
      <tr><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td>
      (This ensures that the interrupt does not get interrupted)
      </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    A 16-bit address is read from <b>$FFFE...$FFFF</b> in memory and placed in <A href="#FLOW">Program Counter (PC)</A>.
    </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  You must supply a special piece of code called <A href="#ISR">The Interrupt Service Routine</A> which will start at
  this address (or "Vector")
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  An <A href="#IRQ">Example/Template Interrupt Service Routine</A> is supplied below
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
What is a "Non-Maskable Interrupt"?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  An NMI is almost identical to an IRQ, but it:
  </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    Uses a different pin on the chip - Namely "/NMI"
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    Is triggered by a Level Change (Eg. from 0V-to-5V or vice versa)
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    Calls a different Routine - Specified by the 16-bit <A href="#MEM_MAP">Vector</a> at <b>$FFFA...$FFFB</b>
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    Cannot be Masked, Disabled, Inhibited or Ignored
    </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
How can I disable Non-Maskable Interrupts?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  You can't - They're <b>NON</b>-Maskable!
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A> has NO effect on NON-Maskable Interrupts
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The purpose of the NMI is to alert the CPU to a critical event.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  You can, of course, design/modify your hardware such that no signals are ever sent to the /NMI pin.  
  That'll stop it working!
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  You might instead write an NMI-Handler which does nothing except RTI.
  Not so much "ignoring it", more akin to saying "yeah, whatever" everytime it tries to interrupt you.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  In very simple computers, NMI is often left unused.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  If the NMI wants your attention - whatever it is, is more important that what you're currently doing.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  If an NMI happens for a trivial task, lean over and slap your hardware engineer sqaure between the
  eyes and when he asks why you just did that, say "oh nothing important" ...he'll soon get the
  message!
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  My Girlfriend is a non-maskable-interrupt.  The telephone isn't!
  </td></tr>
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
What happens when a Non-Maskable Interrupt occurs?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Pretty much the same as a normal Interrupt except the <A href="#MEM_MAP">Vector</a> (address of
  Interrupt Routine) is read from <b>$FFFA...$FFFB</b>
  </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    The current instruction is allowed to finish.
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    The current PC is Pushed onto the <A href="#STACK">Stack</A>.<br>
      <tr><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td>
      (This is the address of the next instruction).
      </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    A copy of the <A href="#FLAGS">Processor Status Word (Flags) (P.?)</A> is Pushed onto the <A href="#STACK">Stack</A>.
    </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    The <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A> is SET<br>
      <tr><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><td>
      (This ensures that the interrupt does not get interrupted)<br>
      Also note that the Flag is SET <b>after</b> the <A href="#FLAGS">Processor Status Word (Flags) (P.?)</A> is Pushed onto
      the <A href="#STACK">Stack</A>
      </td></tr>
    <tr><td width="1%">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td colspan="2">
    A 16-bit address is read from <b>$FFFA...$FFFB</b> in memory and placed in <A href="#FLOW">Program Counter (PC)</A>.
    </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
When does an Interrupt or Non-Maskable Interrupt finish?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Quite simply:  When the CPU finds an <A href="#RTI">RTI - ReTurn from Interrupt</A> instruction.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  It is important to note that an Interrupt will Push "PC" on the <A href="#STACK">Stack</A><br>
  ...Unlike <A href="#JSR">JSR</A> which Pushes "PC-1"
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Therefore when the <A href="#RTI">RTI</A> instruction is executed<br>
  it does NOT need to perform the error correction that is used by <A href="#RTS">RTS</A>
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  This is only relevant if you are playing silly buggers with the <A href="#STACK">Stack</A><br>
  ...but worth noting, in case you do.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  <A href="#RTI">RTI</A> does not actually reset the <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A><br>
  ...but it DOES Pull (Pop) the a copy of the <A href="#FLAGS">Processor Status Word (Flags) (P.?)</A> from the stack as it returns.
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Due to the way that the Interrupt occurs;<br>
  The action of Pulling (POPing) the <A href="#FLAGS">Processor Status Word (Flags) (P.?)</A>
  off the stack<br>
  means that the <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A> is implicitly CLEARed.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The upshot is that under <i>normal</i> conditions <A href="#RTI">RTI</A>
  will CLEAR the <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A>
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
How can I simulate an Interrupt.
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The <A href="#BRK">BRK</A> instruction does precisely this.<br>
  In fact, an IRQ triggers the same ciruit in the chip as <A href="#BRK">BRK</A>.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  It MUST be noted that when <A href="#BRK">BRK</A> Pushes the return address on the <A href="#STACK">Stack</A>,
  it actually Pushes "PC+1".
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  ...Nobody seems to know why, but it does, and <i>you</i> have to deal with it!
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The Interrupt Service Routine suggested below takes cares of this correction.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  Alternatively, you can just put a <A href="#NOP">NOP</A> after each <A href="#BRK">BRK</A> instruction
  </td></tr>

<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<!--blank--><tr><td colspan="4">&nbsp;</td></tr>
<tr><td colspan="4"><font color="black"><big><b>
How do I write an Interrupt Service Routine?
</b></big></font></td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  The following code is an example of an Interrupt Service Routine
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  This code does not realy tackle the issue of Device I/O.<br>
  It is presumed that each device will set bit-7 of a specified memory address to indicate
  that it requires servicing.<br>
  <b>This is NOT always true</b>, you will need to read the respective Device Manual
  to know precisely how each device works.
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td colspan="3">
  There is a LOT more to know about Interrupts and Interrupt Service Routines,<br>
  but it is not considered "in scope" for this document.<br>
  (I've been at this a week and I'm getting bored.)
  </td></tr>
  <!--blank--><tr><td colspan="4">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td colspan="3">
<table summary=""><!-- ISR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<tr><td colspan="2">
      <table summary="" bgcolor="#ffffff"><tr><td><pre>
 <font color="black">IRQ:</font>    <font color="black">; Preserve all registers</font>
         PHA                ; Put A on the Stack
         TXA                ; Put X on the Stack
         PHA                ; ...
         TYA                ; Put Y on the Stack
         PHA                ; ...

 <font color="black">ChkBrk:</font> <font color="black">; Check if Interrupt was caused by a BRK</font>
         TSX                ; Get Stack Pointer to X
         INX                ; =Address where Y is stored
         INX                ; =Address where X is stored
         INX                ; =Address where A is stored
         INX                ; =Address where P is stored
         LDA  $0100,X       ; Get Stack copy of PSW to A
         AND  A,$10         ; Isolate P.B
         BEQ  <font color="black">NotBrk</font>        ; If P.B=0, skip BRK Handling code

 <font color="black">Break:</font>  <font color="black">; Handle BRK Interrupt</font>
         ...
         ...
         ...

 <font color="black">RetAdr:</font> <font color="black">; Correct Return Address error</font>
         TSX                ; Get Stack Pointer to X
         INX                ; =Address where Y is stored
         INX                ; =Address where X is stored
         INX                ; =Address where A is stored
         INX                ; =Address where P is stored
         INX                ; =Address where PC.l is stored
         DEC  $0100,X       ; PC.l = PC.l - 1
         BPL  <font color="black">Return</font>        ; If Page Boundary was NOT crossed
         INC  X             ; =Address where PC.h is stored
         DEC  $0100,X       ; PC.h = PC.h - 1
         STC                ; Branch to return code
         BCS  <font color="black">Return</font>        ; ...

 <font color="black">NotBrk:</font> <font color="black">; Interrupt was caused by hardware IRQ pin</font>
         <font color="black">; Poll each I/O device to see who caused the Interrupt</font>
         LDA  $Device1      ; Get status of device 1
         BMI  <font color="black">Dev1</font>          ; Check if it is active
         ...
         ...
         LDA  $DeviceN      ; Get status of device N
         BMI  <font color="black">DevN</font>          ; Check if it is active
         ; nothing was acive!?

 <font color="black">Return:</font> <font color="black">; Restore registers from stack and ReTurn from Interrupt</font>
         PLA                ; Restore Y
         TAY                ; ...
         PLA                ; Restore X
         TAX                ; ...
         PLA                ; Restore A
         RTI                ; ReTurn from Interrupt

 <font color="black">Dev1:</font>   <font color="black">; Handle Interrupt from Device 1</font>
         <font color="black">STI<font color="black">**</font>              ; Allow Interrupt to be interrupted</font>
         ...
         ...
         STC                ; Branch to return code
         BCS  <font color="black">Return</font>        ; ...

 <font color="black">...</font>     <font color="black">...</font>
         ...
         ...

 <font color="black">DevN:</font>   <font color="black">; Handle Interrupt from Device N</font>
         <font color="black">STI<font color="black">**</font>              ; Allow Interrupt to be interrupted</font>
         ...
         ...
         STC                ; Branch to return code
         BCS  <font color="black">Return</font>        ; ...
                                                                       </pre>
      </td></tr></table>
</td></tr>
</table><!-- ISR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  </td></tr>
  <tr><td>&nbsp;</td><td valign="top" colspan="2" align="center"><font color="black">**</font></td><td>
  If a device is a LOW priority device, you may choose to allow that device to interrupted
  by placing and <A href="#CLI">CLI</A> instruction at the top of it's private handler code.<br>
    <tr><td colspan="2">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td>
    If ZERO Device Handlers contain a <A href="#CLI">CLI</A> instruction then you will be coding
    an "Interrupt Queue".<br>
    </td></tr>
    <tr><td colspan="2">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td>
    If EVERY Device Handlers contain a <A href="#CLI">CLI</A> instruction then you will be coding
    an "Interrupt Stack".<br>
    </td></tr>
    <tr><td colspan="2">&nbsp;</td><td width="1%" valign="top">#&nbsp;</td><td>
    If SOME Device Handlers contain a <A href="#CLI">CLI</A> instruction then you will be coding
    an "Hybrid Interrupt Handler".<br>
    </td></tr>
  <tr><td width="1%" valign="top"> &nbsp;</td><td colspan="3">
  </td></tr>
</table>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="BOOT">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0"><tr><td align="center"><h1><font color="black">
      System Startup sequence (boot-strap)
      </font></h1></td></tr></table>
    </center>
    <br><br>

<table summary="">
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
      At startup the processor will SET the <A href="#FLG-I">Interrupt (disable) Flag (P.I)</A> and
      place the <A href="#MEM_MAP">RESET Vector</A> Address in the <A href="#FLOW">Program Counter (PC)</A>.<br>
      ...and start executing whatever it finds there.
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    The programmer should now:
  </td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <table summary="">
      <tr><td width="1%" valign="top">#&nbsp;</td><td>
        Initialise the <A href="#STACK">Stack</A>
      </td></tr>
      <tr><td width="1%" valign="top">&nbsp;</td><td>
        Note that the <A href="#STACK">Stack</A> is ALWAYS on page 1 (bytes 256..511 of memory)
      </td></tr>
      <tr><td width="1%" valign="top">#&nbsp;</td><td>
        Intialise I/O Devices
      </td></tr>
      <tr><td width="1%" valign="top">#&nbsp;</td><td>
        Enable <A href="#INT">Interrupts</A>
      </td></tr>
      <tr><td width="1%" valign="top">#&nbsp;</td><td>
        Set the <A href="#FLG-D">arithmetic mode</A>
      </td></tr>
      <tr><td colspan="2">&nbsp;</td></tr>
      <tr><td colspan="2">By Example:</td></tr>
      <tr><td width="1%" valign="top">&nbsp;</td><td>
        <table summary="" bgcolor="#ffffff"><tr><td><pre>
 Reset:  LDX  #$FF      ; SP = $01'FF
         TXS            ; ...
         ...
 Init:   Intitialise I/O
         ...
         CLI            ; Enable Interrupts
         CLD            ; Math Mode = Binary
         ...                                  </pre>
        </td></tr></table>
      </td></tr>
    </table>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Each Input/Output (I/O) Device will normally trap reads and writes to block of addresses in the range
    <A href="#MEM_MAP">$4000 to $7FFF</A>.
  </td></tr>
  <tr><td width="1%" valign="top">#&nbsp;</td><td>
    Therefore, each I/O Device is normally initialised by writing a specific value
    to a specific memory address.
  </td></tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr><td width="1%" valign="top">&nbsp;</td><td>
    <table summary="">
      <tr><td colspan="2">By Example:</td></tr>
      <tr><td width="1%" valign="top">&nbsp;</td><td>
        <table summary="" bgcolor="#ffffff"><tr><td><pre>
 Init:   LDA  #$80      ; Enable Controller
         STA  $50FF     ; ...
         LDA  #$A3      ; Disable Audio
         STA  $6125     ; ...
         ...                                    </pre>
        </td></tr></table>
      </td></tr>
    </table>
  </td></tr>
</table>
<br>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <br><br>
    <center>
    <A name="BIBLIO">&nbsp;</A>
      <table summary="" width="90%" bgcolor="#8080FF" border="0">
      <tr><td align="center"><h1><font color="black">
      Bibliography
      </font></h1></td></tr></table>
    </center>
    <br><br>

<br><hr width="50%" align="left">
<table summary="" width="50%">
  <tr>
    <td>"Synertek Programming Manual"</td>
    <td align="right"><A href="http://www.6502.org/datasheets/synertek_databook.pdf">DOWNLOAD</A></td>
  </tr><tr>
    <td colspan="2">Publication Number 6500-50</td>
  </tr><tr>
    <td colspan="2">Written, 1975</td>
  </tr><tr>
    <td colspan="2">Revised, August 1976</td>
  </tr><tr>
    <td colspan="2">Published, May 1978</td>
  </tr><tr>
    <td colspan="2">SynerTek, 3050 Colorado Drive, Santa Clara, Cal. 95051</td>
  </tr>
</table>

<br><hr width="50%" align="left">
<table summary="" width="50%">
  <tr>
    <td>Mastering Machine Code on Your ZX Spectrum</td>
    <td align="right"><A href="http://www.amazon.co.uk/exec/obidos/ASIN/0907563236/ref=sr_aps_books_1_2/202-0956756-0547826  "><s>PURCHASE</s></A></td>
  </tr><tr>
    <td colspan="2">Toni Baker</td>
  </tr><tr>
    <td colspan="2">October 1983</td>
  </tr><tr>
    <td colspan="2">Publisher: Interface</td>
  </tr><tr>
    <td colspan="2">ISBN: 0907563236</td>
  </tr>
</table>

<br><hr width="50%" align="left">
<table summary="" width="50%">
  <tr>
    <td>Rockwell 650x : 651x Data Sheet</td>
    <td align="right"><A href="http://www.6502.org/datasheets/r650x.pdf">DOWNLOAD</A></td>
  </tr><tr>
    <td colspan="2">Document Number 29000D39</td>
  </tr><tr>
    <td colspan="2">Order No. D39</td>
  </tr><tr>
    <td colspan="2">Rev B, June 1987</td>
  </tr>
</table>

<br><hr width="50%" align="left">
<table summary="" width="50%">
  <tr>
    <td>6502 Opcodes</td>
    <td align="right"><A href="http://www.6502.org/tutorials/6502opcodes.htm">VIEW</A></td>
  </tr><tr>
    <td colspan="2">John Pickens</td>
  </tr>
</table>

<br><hr width="50%" align="left">
<table summary="" width="50%">
  <tr>
    <td>Compare Instructions</td>
    <td align="right"><A href="http://www.6502.org/tutorials/compare_instructions.html">VIEW</A></td>
  </tr><tr>
    <td colspan="2">John Pickens</td>
  </tr>
</table>

<br><br>
<i>[Links valid 01/Oct/2003]</i>

      <!-- Bottom of Page -->
      <br><br>
      <table width="100%">
        <tr>
          <td colspan="3">
            <table width="100%"><tr><td bgcolor="#ffffff"><big><b><font color="black">
              &nbsp;
            </font></b></big></td></tr></table>
          </td>
        </tr>
        <tr>
          <td width="33%" align="left">
            &nbsp;
          </td>
          <td width="34%" align="center">
            Authored by: Bluechip
          </td>
          <td width="33%" align="right">
            <!-- Begin Nedstat Basic code -->
            <!-- Title: Rockwell 6502 Programmers Reference -->
            <!-- URL: http://homepage.ntlworld.com/cyborgsystems/6502/6502.htm -->
            <script language="JavaScript" type="text/javascript" src="http://m1.nedstatbasic.net/basic.js">
            </script>
            <script language="JavaScript" type="text/javascript" >
            <!--
              nedstatbasic("ACez2wnOyUTsZAet/PoMx+3lWrhg", 0);
            // -->
            </script>
            <noscript>
            <a target="_blank" href="http://v1.nedstatbasic.net/stats?ACez2wnOyUTsZAet/PoMx+3lWrhg"><img
            src="http://m1.nedstatbasic.net/n?id=ACez2wnOyUTsZAet/PoMx+3lWrhg"
            border="0" nosave width="18" height="18"
            alt="Nedstat Basic - Free web site statistics"></a>
            </noscript>
            <!-- End Nedstat Basic code -->
          </td>
        </tr>
      </table>

  </body>

</html>
